mirror of
https://github.com/bitwarden/jslib
synced 2025-12-13 06:43:20 +00:00
[Reset Password v1] Refactor ForcePasswordReset into AuthResult (#481)
This commit is contained in:
@@ -39,9 +39,11 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
|
||||
onSuccessfulLogin: () => Promise<any>;
|
||||
onSuccessfulLoginNavigate: () => Promise<any>;
|
||||
onSuccessfulLoginTwoFactorNavigate: () => Promise<any>;
|
||||
onSuccessfulLoginForceResetNavigate: () => Promise<any>;
|
||||
|
||||
protected twoFactorRoute = '2fa';
|
||||
protected successRoute = 'vault';
|
||||
protected forcePasswordResetRoute = 'update-temp-password';
|
||||
|
||||
constructor(protected authService: AuthService, protected router: Router,
|
||||
platformUtilsService: PlatformUtilsService, i18nService: I18nService,
|
||||
@@ -103,6 +105,12 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
|
||||
} else {
|
||||
this.router.navigate([this.twoFactorRoute]);
|
||||
}
|
||||
} else if (response.forcePasswordReset) {
|
||||
if (this.onSuccessfulLoginForceResetNavigate != null) {
|
||||
this.onSuccessfulLoginForceResetNavigate();
|
||||
} else {
|
||||
this.router.navigate([this.forcePasswordResetRoute]);
|
||||
}
|
||||
} else {
|
||||
const disableFavicon = await this.storageService.get<boolean>(ConstantsService.disableFaviconKey);
|
||||
await this.stateService.save(ConstantsService.disableFaviconKey, !!disableFavicon);
|
||||
|
||||
Reference in New Issue
Block a user