mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
[PM-6302, PM-6303] Add duo state and connector message on browser/desktop (#7957)
* pass state for clients * use redirect connector to set cookie with translations * simplify duo redirect url validation
This commit is contained in:
@@ -127,7 +127,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
|
||||
await this.ngZone.run(async () => {
|
||||
if (message.command === "duoCallback") {
|
||||
this.token = message.code;
|
||||
this.token = message.code + "|" + message.state;
|
||||
await this.submit();
|
||||
}
|
||||
});
|
||||
@@ -136,6 +136,25 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
}
|
||||
}
|
||||
|
||||
override launchDuoFrameless() {
|
||||
const duoHandOffMessage = {
|
||||
title: this.i18nService.t("youSuccessfullyLoggedIn"),
|
||||
message: this.i18nService.t("youMayCloseThisWindow"),
|
||||
isCountdown: false,
|
||||
};
|
||||
|
||||
// we're using the connector here as a way to set a cookie with translations
|
||||
// before continuing to the duo frameless url
|
||||
const launchUrl =
|
||||
this.environmentService.getWebVaultUrl() +
|
||||
"/duo-redirect-connector.html" +
|
||||
"?duoFramelessUrl=" +
|
||||
encodeURIComponent(this.duoFramelessUrl) +
|
||||
"&handOffMessage=" +
|
||||
encodeURIComponent(JSON.stringify(duoHandOffMessage));
|
||||
this.platformUtilsService.launchUri(launchUrl);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.duoCallbackSubscriptionEnabled) {
|
||||
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
|
||||
|
||||
@@ -560,6 +560,12 @@
|
||||
"newAccountCreated": {
|
||||
"message": "Your new account has been created! You may now log in."
|
||||
},
|
||||
"youSuccessfullyLoggedIn": {
|
||||
"message": "You successfully logged in"
|
||||
},
|
||||
"youMayCloseThisWindow": {
|
||||
"message": "You may close this window"
|
||||
},
|
||||
"masterPassSent": {
|
||||
"message": "We've sent you an email with your master password hint."
|
||||
},
|
||||
@@ -2484,7 +2490,7 @@
|
||||
},
|
||||
"aliasDomain": {
|
||||
"message": "Alias domain"
|
||||
},
|
||||
},
|
||||
"importData": {
|
||||
"message": "Import data",
|
||||
"description": "Used for the desktop menu item and the header of the import dialog"
|
||||
|
||||
Reference in New Issue
Block a user