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:
parent
dd4ef7b812
commit
171d9511db
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user