1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-19 01:51:27 +01:00

PM-8113 - Update ExtensionTwoFactorAuthComponentService to close email 2FA single action popouts.

This commit is contained in:
Jared Snider 2025-01-23 18:28:27 -05:00
parent dd4ef7b812
commit 171d9511db
No known key found for this signature in database
GPG Key ID: A149DDD612516286
2 changed files with 19 additions and 6 deletions

View File

@ -9,7 +9,8 @@ import BrowserPopupUtils from "../../platform/popup/browser-popup-utils";
import {
AuthPopoutType,
closeSsoAuthResultPopout,
closeTwoFactorAuthPopout,
closeTwoFactorAuthEmailPopout,
closeTwoFactorAuthWebAuthnPopout,
} from "../popup/utils/auth-popout-window";
export class ExtensionTwoFactorAuthComponentService
@ -67,13 +68,24 @@ export class ExtensionTwoFactorAuthComponentService
return;
}
const inTwoFactorAuthPopout = BrowserPopupUtils.inSingleActionPopout(
const inTwoFactorAuthWebAuthnPopout = BrowserPopupUtils.inSingleActionPopout(
this.window,
AuthPopoutType.twoFactorAuth,
AuthPopoutType.twoFactorAuthWebAuthn,
);
if (inTwoFactorAuthPopout) {
await closeTwoFactorAuthPopout();
if (inTwoFactorAuthWebAuthnPopout) {
await closeTwoFactorAuthWebAuthnPopout();
return;
}
const inTwoFactorAuthEmailPopout = BrowserPopupUtils.inSingleActionPopout(
this.window,
AuthPopoutType.twoFactorAuthEmail,
);
if (inTwoFactorAuthEmailPopout) {
await closeTwoFactorAuthEmailPopout();
return;
}
}

View File

@ -4,6 +4,7 @@ import {
} from "@bitwarden/auth/angular";
import { DialogService } from "@bitwarden/components";
import { openTwoFactorAuthEmailPopout } from "../../auth/popup/utils/auth-popout-window";
import BrowserPopupUtils from "../../platform/popup/browser-popup-utils";
// TODO: popup state persistence should eventually remove the need for this service
@ -26,7 +27,7 @@ export class ExtensionTwoFactorAuthEmailComponentService
type: "warning",
});
if (confirmed) {
await BrowserPopupUtils.openCurrentPagePopout(this.window);
await openTwoFactorAuthEmailPopout();
}
}
}