diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 46e0b9663..e794ec354 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -235,8 +235,7 @@ Devise.setup do |config| # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. if !Rails.env.test? - github_secrets = YAML::load_file(File.join(__dir__, '../github_secrets.yml')) - config.omniauth :github, github_secrets['client_id'], github_secrets['client_secret'], scope: 'user:email' + config.omniauth :github, Rails.application.secrets.github[:client_id], Rails.application.secrets.github[:client_secret], scope: 'user:email' end # ==> Warden configuration diff --git a/config/secrets.yml b/config/secrets.yml index 0e4c66326..a73566efa 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -18,6 +18,9 @@ defaults: &defaults token_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/token userinfo_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/userinfo logout_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/logout + github: + client_id: <%= ENV['GITHUB_CLIENT_ID'] %> + client_secret: <%= ENV['GITHUB_CLIENT_SECRET'] %> development: <<: *defaults