1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

Refactored fido2 popup to use auth guard when routing to component, added BrowserRouterService to track previous page and route using that

This commit is contained in:
gbubemismith
2023-09-04 15:29:48 -04:00
parent 43db7f6d60
commit c204c70e6b
6 changed files with 123 additions and 4 deletions

View File

@@ -2828,6 +2828,23 @@ export class StateService<
);
}
async getPreviousUrl(options?: StorageOptions): Promise<string> {
return (
await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()))
)?.previousUrl;
}
async setPreviousUrl(url: string, options?: StorageOptions): Promise<void> {
const globals = await this.getGlobals(
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
);
globals.previousUrl = url;
await this.saveGlobals(
globals,
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
);
}
protected async getGlobals(options: StorageOptions): Promise<TGlobalState> {
let globals: TGlobalState;
if (this.useMemory(options.storageLocation)) {