1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

[BEEEP] Allow linking to ciphers (#760)

This commit is contained in:
Oscar Hinton 2022-04-20 11:15:58 +02:00 committed by GitHub
parent ad37de9373
commit f6e3481fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 25 deletions

View File

@ -61,7 +61,6 @@ export class UpdatePasswordComponent extends BaseChangePasswordComponent {
async cancel() {
await this.stateService.setOrganizationInvitation(null);
await this.stateService.setLoginRedirect(null);
this.router.navigate(["/vault"]);
}

View File

@ -19,7 +19,7 @@ export class AuthGuardService implements CanActivate {
async canActivate(route: ActivatedRouteSnapshot, routerState: RouterStateSnapshot) {
const isAuthed = await this.stateService.getIsAuthenticated();
if (!isAuthed) {
this.messagingService.send("authBlocked");
this.messagingService.send("authBlocked", { url: routerState.url });
return false;
}
@ -28,16 +28,14 @@ export class AuthGuardService implements CanActivate {
if (routerState != null) {
this.messagingService.send("lockedUrl", { url: routerState.url });
}
this.router.navigate(["lock"], { queryParams: { promptBiometric: true } });
return false;
return this.router.createUrlTree(["lock"], { queryParams: { promptBiometric: true } });
}
if (
!routerState.url.includes("remove-password") &&
(await this.keyConnectorService.getConvertAccountRequired())
) {
this.router.navigate(["/remove-password"]);
return false;
return this.router.createUrlTree(["/remove-password"]);
}
return true;

View File

@ -18,11 +18,9 @@ export class UnauthGuardService implements CanActivate {
if (isAuthed) {
const locked = await this.vaultTimeoutService.isLocked();
if (locked) {
this.router.navigate(["lock"]);
} else {
this.router.navigate([this.homepage]);
return this.router.createUrlTree(["lock"]);
}
return false;
return this.router.createUrlTree([this.homepage]);
}
return true;
}

View File

@ -242,8 +242,6 @@ export abstract class StateService<T extends Account = Account> {
setLocalData: (value: string, options?: StorageOptions) => Promise<void>;
getLocale: (options?: StorageOptions) => Promise<string>;
setLocale: (value: string, options?: StorageOptions) => Promise<void>;
getLoginRedirect: (options?: StorageOptions) => Promise<any>;
setLoginRedirect: (value: any, options?: StorageOptions) => Promise<void>;
getMainWindowSize: (options?: StorageOptions) => Promise<number>;
setMainWindowSize: (value: number, options?: StorageOptions) => Promise<void>;
getMinimizeOnCopyToClipboard: (options?: StorageOptions) => Promise<boolean>;

View File

@ -1633,19 +1633,6 @@ export class StateService<
);
}
async getLoginRedirect(options?: StorageOptions): Promise<any> {
return (await this.getGlobals(this.reconcileOptions(options, this.defaultInMemoryOptions)))
?.loginRedirect;
}
async setLoginRedirect(value: any, options?: StorageOptions): Promise<void> {
const globals = await this.getGlobals(
this.reconcileOptions(options, this.defaultInMemoryOptions)
);
globals.loginRedirect = value;
await this.saveGlobals(globals, this.reconcileOptions(options, this.defaultInMemoryOptions));
}
async getMainWindowSize(options?: StorageOptions): Promise<number> {
return (await this.getGlobals(this.reconcileOptions(options, this.defaultInMemoryOptions)))
?.mainWindowSize;