mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-03 18:28:13 +01:00
[Reset Password v1] Refactor ForcePasswordReset flow (#2063)
* [Reset Password v1] Refactor ForcePasswordReset flow * Update jslib
This commit is contained in:
parent
f1dcbdb6de
commit
c1613f79cd
@ -10,7 +10,6 @@ import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.se
|
|||||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||||
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||||
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
|
||||||
|
|
||||||
import { LoginComponent as BaseLoginComponent } from 'jslib-angular/components/login.component';
|
import { LoginComponent as BaseLoginComponent } from 'jslib-angular/components/login.component';
|
||||||
|
|
||||||
@ -24,14 +23,10 @@ export class LoginComponent extends BaseLoginComponent {
|
|||||||
protected stateService: StateService, protected environmentService: EnvironmentService,
|
protected stateService: StateService, protected environmentService: EnvironmentService,
|
||||||
protected passwordGenerationService: PasswordGenerationService,
|
protected passwordGenerationService: PasswordGenerationService,
|
||||||
protected cryptoFunctionService: CryptoFunctionService, storageService: StorageService,
|
protected cryptoFunctionService: CryptoFunctionService, storageService: StorageService,
|
||||||
syncService: SyncService, private userService: UserService) {
|
syncService: SyncService) {
|
||||||
super(authService, router, platformUtilsService, i18nService, stateService, environmentService, passwordGenerationService, cryptoFunctionService, storageService);
|
super(authService, router, platformUtilsService, i18nService, stateService, environmentService, passwordGenerationService, cryptoFunctionService, storageService);
|
||||||
super.onSuccessfulLogin = async () => {
|
super.onSuccessfulLogin = async () => {
|
||||||
await syncService.fullSync(true).then(async () => {
|
await syncService.fullSync(true);
|
||||||
if (await this.userService.getForcePasswordReset()) {
|
|
||||||
this.router.navigate(['update-temp-password']);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
super.successRoute = '/tabs/vault';
|
super.successRoute = '/tabs/vault';
|
||||||
}
|
}
|
||||||
|
@ -31,13 +31,6 @@ export class SetPasswordComponent extends BaseSetPasswordComponent {
|
|||||||
syncService: SyncService, route: ActivatedRoute) {
|
syncService: SyncService, route: ActivatedRoute) {
|
||||||
super(i18nService, cryptoService, messagingService, userService, passwordGenerationService,
|
super(i18nService, cryptoService, messagingService, userService, passwordGenerationService,
|
||||||
platformUtilsService, policyService, router, apiService, syncService, route);
|
platformUtilsService, policyService, router, apiService, syncService, route);
|
||||||
super.onSuccessfulChangePassword = async () => {
|
|
||||||
if (await this.userService.getForcePasswordReset()) {
|
|
||||||
this.router.navigate(['update-temp-password']);
|
|
||||||
} else {
|
|
||||||
this.router.navigate([this.successRoute]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get masterPasswordScoreWidth() {
|
get masterPasswordScoreWidth() {
|
||||||
|
@ -15,7 +15,6 @@ import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.se
|
|||||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||||
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||||
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
|
||||||
|
|
||||||
import { SsoComponent as BaseSsoComponent } from 'jslib-angular/components/sso.component';
|
import { SsoComponent as BaseSsoComponent } from 'jslib-angular/components/sso.component';
|
||||||
import { BrowserApi } from '../../browser/browserApi';
|
import { BrowserApi } from '../../browser/browserApi';
|
||||||
@ -30,7 +29,7 @@ export class SsoComponent extends BaseSsoComponent {
|
|||||||
storageService: StorageService, stateService: StateService,
|
storageService: StorageService, stateService: StateService,
|
||||||
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
||||||
cryptoFunctionService: CryptoFunctionService, passwordGenerationService: PasswordGenerationService,
|
cryptoFunctionService: CryptoFunctionService, passwordGenerationService: PasswordGenerationService,
|
||||||
syncService: SyncService, environmentService: EnvironmentService, private userService: UserService) {
|
syncService: SyncService, environmentService: EnvironmentService) {
|
||||||
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
|
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
|
||||||
apiService, cryptoFunctionService, environmentService, passwordGenerationService);
|
apiService, cryptoFunctionService, environmentService, passwordGenerationService);
|
||||||
|
|
||||||
@ -45,13 +44,5 @@ export class SsoComponent extends BaseSsoComponent {
|
|||||||
const thisWindow = window.open('', '_self');
|
const thisWindow = window.open('', '_self');
|
||||||
thisWindow.close();
|
thisWindow.close();
|
||||||
};
|
};
|
||||||
|
|
||||||
super.onSuccessfulLoginNavigate = async () => {
|
|
||||||
if (await this.userService.getForcePasswordReset()) {
|
|
||||||
this.router.navigate(['update-temp-password']);
|
|
||||||
} else {
|
|
||||||
this.router.navigate([this.successRoute]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.se
|
|||||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||||
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||||
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
|
||||||
|
|
||||||
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
|
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
|
||||||
|
|
||||||
@ -45,16 +44,11 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
|||||||
environmentService: EnvironmentService, private ngZone: NgZone,
|
environmentService: EnvironmentService, private ngZone: NgZone,
|
||||||
private broadcasterService: BroadcasterService, private changeDetectorRef: ChangeDetectorRef,
|
private broadcasterService: BroadcasterService, private changeDetectorRef: ChangeDetectorRef,
|
||||||
private popupUtilsService: PopupUtilsService, stateService: StateService,
|
private popupUtilsService: PopupUtilsService, stateService: StateService,
|
||||||
storageService: StorageService, route: ActivatedRoute, private messagingService: MessagingService,
|
storageService: StorageService, route: ActivatedRoute, private messagingService: MessagingService) {
|
||||||
private userService: UserService) {
|
|
||||||
super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService,
|
super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService,
|
||||||
stateService, storageService, route);
|
stateService, storageService, route);
|
||||||
super.onSuccessfulLogin = async () => {
|
super.onSuccessfulLogin = () => {
|
||||||
return syncService.fullSync(true).then(async () => {
|
return syncService.fullSync(true);
|
||||||
if (await this.userService.getForcePasswordReset()) {
|
|
||||||
this.router.navigate(['update-temp-password']);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
super.successRoute = '/tabs/vault';
|
super.successRoute = '/tabs/vault';
|
||||||
this.webAuthnNewTab = this.platformUtilsService.isFirefox() || this.platformUtilsService.isSafari();
|
this.webAuthnNewTab = this.platformUtilsService.isFirefox() || this.platformUtilsService.isSafari();
|
||||||
|
Loading…
Reference in New Issue
Block a user