feat: migrate facebook env vars to globalConfig (#3369)

Migrate facebook env vars to globalConfig and make it editable from the super admin UI.
This commit is contained in:
Vishnu Narayanan
2021-11-25 00:55:26 +05:30
committed by GitHub
parent c23e2c23d4
commit 3a48e08fe0
8 changed files with 26 additions and 12 deletions

View File

@@ -74,7 +74,7 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
end
def long_lived_token(omniauth_token)
koala = Koala::Facebook::OAuth.new(ENV['FB_APP_ID'], ENV['FB_APP_SECRET'])
koala = Koala::Facebook::OAuth.new(GlobalConfigService.load('FB_APP_ID', ''), GlobalConfigService.load('FB_APP_SECRET', ''))
koala.exchange_access_token_info(omniauth_token)['access_token']
rescue StandardError => e
Rails.logger.info e