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:
parent
e19f3ea04e
commit
38dc309ac5
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user