1
0
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:
2019-02-04 16:06:09 +01:00
parent 8ba5608689
commit f70a5275f0
8 changed files with 50 additions and 3 deletions

View File

@@ -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.