feat: Show re-auth flag only for legacy Gmail and OAuth channels (#10189)
This commit is contained in:
@@ -61,6 +61,10 @@ class Channel::Email < ApplicationRecord
|
|||||||
provider == 'google'
|
provider == 'google'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def legacy_google?
|
||||||
|
imap_enabled && imap_address == 'imap.gmail.com'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def ensure_forward_to_email
|
def ensure_forward_to_email
|
||||||
|
|||||||
@@ -72,8 +72,10 @@ if resource.email?
|
|||||||
json.imap_port resource.channel.try(:imap_port)
|
json.imap_port resource.channel.try(:imap_port)
|
||||||
json.imap_enabled resource.channel.try(:imap_enabled)
|
json.imap_enabled resource.channel.try(:imap_enabled)
|
||||||
json.imap_enable_ssl resource.channel.try(:imap_enable_ssl)
|
json.imap_enable_ssl resource.channel.try(:imap_enable_ssl)
|
||||||
# show this even for regular imap channels, to allow transitioning to OAuth
|
|
||||||
json.reauthorization_required resource.channel.try(:provider_config).empty? || resource.channel.try(:reauthorization_required?)
|
if resource.channel.try(:microsoft?) || resource.channel.try(:google?) || resource.channel.try(:legacy_google?)
|
||||||
|
json.reauthorization_required resource.channel.try(:provider_config).empty? || resource.channel.try(:reauthorization_required?)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
## SMTP
|
## SMTP
|
||||||
|
|||||||
Reference in New Issue
Block a user