mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
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'
|
||||
end
|
||||
|
||||
def legacy_google?
|
||||
imap_enabled && imap_address == 'imap.gmail.com'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def ensure_forward_to_email
|
||||
|
||||
@@ -72,8 +72,10 @@ if resource.email?
|
||||
json.imap_port resource.channel.try(:imap_port)
|
||||
json.imap_enabled resource.channel.try(:imap_enabled)
|
||||
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
|
||||
|
||||
## SMTP
|
||||
|
||||
Reference in New Issue
Block a user