diff --git a/src/app/accounts/sso.component.ts b/src/app/accounts/sso.component.ts index 0c80ac5fa1..f71f478aea 100644 --- a/src/app/accounts/sso.component.ts +++ b/src/app/accounts/sso.component.ts @@ -53,6 +53,9 @@ export class SsoComponent extends BaseSsoComponent { async submit() { await this.storageService.save(IdentifierStorageKey, this.identifier); + if (this.clientId === 'browser') { + document.cookie = `ssoHandOffMessage=${this.i18nService.t('ssoHandOff')};SameSite=strict` + } super.submit(); } } diff --git a/src/connectors/sso.html b/src/connectors/sso.html index b82716764e..32078c2954 100644 --- a/src/connectors/sso.html +++ b/src/connectors/sso.html @@ -19,9 +19,11 @@
-

- -

+
+

+ +

+
diff --git a/src/connectors/sso.ts b/src/connectors/sso.ts index a21e5fcd67..46457b7bc4 100644 --- a/src/connectors/sso.ts +++ b/src/connectors/sso.ts @@ -37,6 +37,10 @@ function getQsParam(name: string) { function initiateBrowserSso(code: string, state: string) { window.postMessage({ command: 'authResult', code: code, state: state }, '*'); + let handOffMessage = ('; ' + document.cookie).split('; ssoHandOffMessage=').pop().split(';').shift(); + document.cookie = 'ssoHandOffMessage=;SameSite=strict;max-age=0' + document.getElementById('content').innerHTML = + `

${handOffMessage}

`; } function extractFromRegex(s: string, regexString: string) { diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index c33f23fc39..35ab61958c 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -3193,6 +3193,9 @@ "enterpriseSingleSignOn": { "message": "Enterprise Single Sign-On" }, + "ssoHandOff": { + "message": "You may now close this tab and continue in the extension." + }, "businessPortal": { "message": "Business Portal", "description": "The web portal used by business organizations for configuring certain features."