[ENV] GH config in secrets.yml

This commit is contained in:
Mathieu Magnin 2018-02-09 10:34:50 +01:00 committed by Paul Chavard
parent 238d94cdc3
commit 8934d495e9
2 changed files with 4 additions and 2 deletions

View file

@ -235,8 +235,7 @@ Devise.setup do |config|
# Add a new OmniAuth provider. Check the wiki for more information on setting # Add a new OmniAuth provider. Check the wiki for more information on setting
# up on your models and hooks. # up on your models and hooks.
if !Rails.env.test? if !Rails.env.test?
github_secrets = YAML::load_file(File.join(__dir__, '../github_secrets.yml')) config.omniauth :github, Rails.application.secrets.github[:client_id], Rails.application.secrets.github[:client_secret], scope: 'user:email'
config.omniauth :github, github_secrets['client_id'], github_secrets['client_secret'], scope: 'user:email'
end end
# ==> Warden configuration # ==> Warden configuration

View file

@ -18,6 +18,9 @@ defaults: &defaults
token_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/token token_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/token
userinfo_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/userinfo userinfo_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/userinfo
logout_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/logout logout_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/logout
github:
client_id: <%= ENV['GITHUB_CLIENT_ID'] %>
client_secret: <%= ENV['GITHUB_CLIENT_SECRET'] %>
development: development:
<<: *defaults <<: *defaults