mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-27 02:28:50 +01:00
Add authentication via GitHub
This commit is contained in:
@@ -233,8 +233,15 @@ Devise.setup do |config|
|
||||
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
||||
# up on your models and hooks.
|
||||
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
||||
config.omniauth :developer, fields: [:name], uid_field: :name
|
||||
|
||||
if Rails.env.development?
|
||||
config.omniauth :developer, fields: [:name], uid_field: :name
|
||||
end
|
||||
if Rails.env.production?
|
||||
config.omniauth :github, Rails.application.credentials.github[:client_id], Rails.application.credentials.github[:client_secret], scope: ''
|
||||
end
|
||||
if Rails.env.test?
|
||||
config.omniauth :github, '', '', scope: ''
|
||||
end
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not supported by Devise, or
|
||||
# change the failure app, you can configure them inside the config.warden block.
|
||||
|
||||
Reference in New Issue
Block a user