1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-03 17:13:47 +00:00

refactored router service to not store on the disk

This commit is contained in:
gbubemismith
2023-09-07 22:21:01 -04:00
parent 003990b23f
commit 99399df8dc
9 changed files with 14 additions and 50 deletions

View File

@@ -524,17 +524,4 @@ export abstract class StateService<T extends Account = Account> {
value: Record<string, Record<string, boolean>>,
options?: StorageOptions
) => Promise<void>;
/**
* fetches string value of the URL stored here, usually only called after SSO flows.
* @param options Defines the storage options for the URL; Defaults to Local Storage.
* @returns route called prior to SSO routing to organizations configured IdP.
*/
getPreviousUrl: (options?: StorageOptions) => Promise<string>;
/**
* Store URL in local storage by default, but can be configured. Developed to handle
* SSO routing to organizations configured IdP.
* @param url URL of route
* @param options Defines the storage options for the URL; Defaults to Local Storage.
*/
setPreviousUrl: (url: string, options?: StorageOptions) => Promise<void>;
}

View File

@@ -37,5 +37,4 @@ export class GlobalState {
enableBrowserIntegrationFingerprint?: boolean;
enableDuckDuckGoBrowserIntegration?: boolean;
region?: string;
previousUrl?: string;
}

View File

@@ -2828,23 +2828,6 @@ 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)) {

View File

@@ -83,8 +83,7 @@ export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstr
throw new Fido2AutenticatorError(Fido2AutenticatorErrorCode.Unknown);
}
//TODO: uncomment this when working on the login flow ticket
// await userInterfaceSession.ensureUnlockedVault();
await userInterfaceSession.ensureUnlockedVault();
const existingCipherIds = await this.findExcludedCredentials(
params.excludeCredentialDescriptorList
@@ -238,8 +237,7 @@ export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstr
let cipherOptions: CipherView[];
//TODO: uncomment this when working on the login flow ticket
// await userInterfaceSession.ensureUnlockedVault();
await userInterfaceSession.ensureUnlockedVault();
// eslint-disable-next-line no-empty
if (params.allowCredentialDescriptorList?.length > 0) {