From fdb3d2bdcefebc55e8b423df65387c2f45aef634 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Wed, 14 Jun 2023 20:05:53 -0400 Subject: [PATCH] use more consent-y prompt for google --- ext/oauth-client/CRM/OAuth/MailSetup.php | 3 ++- ext/oauth-client/providers/gmail.dist.json | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/oauth-client/CRM/OAuth/MailSetup.php b/ext/oauth-client/CRM/OAuth/MailSetup.php index 99450579d8..42442c0a5c 100644 --- a/ext/oauth-client/CRM/OAuth/MailSetup.php +++ b/ext/oauth-client/CRM/OAuth/MailSetup.php @@ -23,6 +23,7 @@ class CRM_OAuth_MailSetup { 'title' => sprintf('%s (ID #%s)', $provider['title'] ?? $provider['name'] ?? ts('OAuth2'), $client['id']), 'callback' => ['CRM_OAuth_MailSetup', 'setup'], 'oauth_client_id' => $client['id'], + 'prompt' => $provider['options']['prompt'] ?? NULL, ]; } } @@ -46,7 +47,7 @@ class CRM_OAuth_MailSetup { ->addWhere('id', '=', $setupAction['oauth_client_id']) ->setStorage('OAuthSysToken') ->setTag('MailSettings:setup') - ->setPrompt('select_account') + ->setPrompt($setupAction['prompt'] ?? 'select_account') ->execute() ->single(); diff --git a/ext/oauth-client/providers/gmail.dist.json b/ext/oauth-client/providers/gmail.dist.json index c8b9426e71..0b9776a0c8 100644 --- a/ext/oauth-client/providers/gmail.dist.json +++ b/ext/oauth-client/providers/gmail.dist.json @@ -10,7 +10,8 @@ "scopes": [ "https://mail.google.com/", "openid" - ] + ], + "prompt": "select_account consent" }, "mailSettingsTemplate": { "name": "{{token.resource_owner.email}}", @@ -23,4 +24,4 @@ "password": null, "is_ssl": true } -} \ No newline at end of file +} -- 2.25.1