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

@@ -50,7 +50,7 @@ class Instagram::SendOnInstagramService < Base::SendOnChannelService
# @see https://developers.facebook.com/docs/messenger-platform/instagram/features/send-message
def send_to_facebook_page(message_content)
access_token = channel.page_access_token
app_secret_proof = calculate_app_secret_proof(ENV['FB_APP_SECRET'], access_token)
app_secret_proof = calculate_app_secret_proof(GlobalConfigService.load('FB_APP_SECRET', ''), access_token)
query = { access_token: access_token }
query[:appsecret_proof] = app_secret_proof if app_secret_proof