1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-16 01:21:48 +01:00

PM-8113 - TwoFactorAuthComponent - finish refactoring out all callbacks

This commit is contained in:
Jared Snider 2024-12-15 14:21:16 -05:00
parent e19f3ea04e
commit 38dc309ac5
No known key found for this signature in database
GPG Key ID: A149DDD612516286
3 changed files with 13 additions and 3 deletions

View File

@ -55,6 +55,10 @@ export class ExtensionTwoFactorAuthComponentService
}
}
closeWindow(): void {
this.window.close();
}
async handleSso2faFlowSuccess(): Promise<void> {
// Force sidebars (FF && Opera) to reload while exempting current window
// because we are just going to close the current window.

View File

@ -37,6 +37,11 @@ export abstract class TwoFactorAuthComponentService {
selected2faProviderType: TwoFactorProviderType,
): Promise<void>;
/**
* Optionally closes the window if the client requires it
*/
abstract closeWindow?(): void;
/**
* We used to use the user's master key to encrypt their data. We deprecated that approach
* and now use a user key. This method should be called if we detect that the user

View File

@ -380,9 +380,10 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
);
}
// TODO: extension has this.onSuccessfulLoginTdeNavigate = async () => {
// this.win.close();
// };
if (this.twoFactorAuthComponentService.closeWindow) {
this.twoFactorAuthComponentService.closeWindow();
return;
}
await this.router.navigate([this.trustedDeviceEncRoute]);
}