Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
[BEEEP] Allow linking to ciphers (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Apr 20, 2022
1 parent ad37de9 commit f6e3481
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
1 change: 0 additions & 1 deletion angular/src/components/update-password.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
}

Expand Down
8 changes: 3 additions & 5 deletions angular/src/services/auth-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions angular/src/services/unauth-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions common/src/abstractions/state.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
13 changes: 0 additions & 13 deletions common/src/services/state.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f6e3481

Please sign in to comment.