chore: Mark Facebook accounts for reconnection (#2405)

fixes: #2037
This commit is contained in:
Sojan Jose
2021-08-01 18:15:39 +05:30
committed by GitHub
parent 2890339734
commit e46aa1aa64
9 changed files with 112 additions and 22 deletions

View File

@@ -36,9 +36,13 @@ module Reauthorizable
# could used to manually prompt reauthorization if auth scope changes
def prompt_reauthorization!
::Redis::Alfred.set(reauthorization_required_key, true)
return unless (is_a? Integrations::Hook) && slack?
AdministratorNotifications::ChannelNotificationsMailer.with(account: account).slack_disconnect(account)&.deliver_later
if (is_a? Integrations::Hook) && slack?
AdministratorNotifications::ChannelNotificationsMailer.with(account: account).slack_disconnect.deliver_later
end
return unless is_a? Channel::FacebookPage
AdministratorNotifications::ChannelNotificationsMailer.with(account: account).facebook_disconnect(inbox).deliver_later
end
# call this after you successfully Reauthorized the object in UI