1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +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:
Jake Fink
2024-02-14 18:00:38 -05:00
committed by GitHub
parent 973b95fe38
commit 6562875a23
9 changed files with 121 additions and 17 deletions

View File

@@ -117,11 +117,22 @@ export class TwoFactorComponent extends BaseTwoFactorComponent implements OnDest
}
}
private handleDuoResultMessage = async (msg: { data: { code: string } }) => {
this.token = msg.data.code;
private handleDuoResultMessage = async (msg: { data: { code: string; state: string } }) => {
this.token = msg.data.code + "|" + msg.data.state;
await this.submit();
};
override launchDuoFrameless() {
const duoHandOffMessage = {
title: this.i18nService.t("youSuccessfullyLoggedIn"),
message: this.i18nService.t("thisWindowWillCloseIn5Seconds"),
buttonText: this.i18nService.t("close"),
isCountdown: true,
};
document.cookie = `duoHandOffMessage=${JSON.stringify(duoHandOffMessage)}; SameSite=strict;`;
this.platformUtilsService.launchUri(this.duoFramelessUrl);
}
async ngOnDestroy() {
super.ngOnDestroy();