mirror of
https://github.com/bitwarden/jslib
synced 2025-12-21 18:53:32 +00:00
[bug] Add loginRedirect to the account model
This commit is contained in:
@@ -110,6 +110,7 @@ export abstract class StateService {
|
||||
getLegacyEtmKey: (options?: StorageOptions) => Promise<SymmetricCryptoKey>;
|
||||
getLocalData: (options?: StorageOptions) => Promise<any>;
|
||||
getLocale: (options?: StorageOptions) => Promise<string>;
|
||||
getLoginRedirect: (options?: StorageOptions) => Promise<any>;
|
||||
getMainWindowSize: (options?: StorageOptions) => Promise<number>;
|
||||
getMinimizeOnCopyToClipboard: (options?: StorageOptions) => Promise<boolean>;
|
||||
getNeverDomains: (options?: StorageOptions) => Promise<{ [id: string]: any }>;
|
||||
@@ -213,6 +214,7 @@ export abstract class StateService {
|
||||
setLegacyEtmKey: (value: SymmetricCryptoKey, options?: StorageOptions) => Promise<void>;
|
||||
setLocalData: (value: string, options?: StorageOptions) => Promise<void>;
|
||||
setLocale: (value: string, options?: StorageOptions) => Promise<void>;
|
||||
setLoginRedirect: (value: any, options?: StorageOptions) => Promise<void>;
|
||||
setMainWindowSize: (value: number, options?: StorageOptions) => Promise<void>;
|
||||
setMinimizeOnCopyToClipboard: (value: boolean, options?: StorageOptions) => Promise<void>;
|
||||
setNeverDomains: (value: { [id: string]: any }, options?: StorageOptions) => Promise<void>;
|
||||
|
||||
@@ -88,6 +88,7 @@ export class Account {
|
||||
lastSync: string;
|
||||
legacyEtmKey: SymmetricCryptoKey;
|
||||
localData: any;
|
||||
loginRedirect: any;
|
||||
mainWindowSize: number;
|
||||
minimizeOnCopyToClipboard: boolean;
|
||||
neverDomains: string[];
|
||||
|
||||
@@ -340,6 +340,10 @@ export class StateService implements StateServiceAbstraction {
|
||||
return (await this.getAccount(options ?? { storageLocation: StorageLocation.Memory }))?.locale;
|
||||
}
|
||||
|
||||
async getLoginRedirect(options?: StorageOptions): Promise<string> {
|
||||
return (await this.getAccount(options ?? { storageLocation: StorageLocation.Memory }))?.loginRedirect;
|
||||
}
|
||||
|
||||
async getMainWindowSize(options?: StorageOptions): Promise<number> {
|
||||
return (await this.getAccount(options ?? { storageLocation: StorageLocation.Memory }))?.mainWindowSize;
|
||||
}
|
||||
@@ -886,6 +890,12 @@ export class StateService implements StateServiceAbstraction {
|
||||
await this.saveAccount(account, options ?? { storageLocation: StorageLocation.Memory });
|
||||
}
|
||||
|
||||
async setLoginRedirect(value: any, options?: StorageOptions): Promise<void> {
|
||||
const account = await this.getAccount(options ?? { storageLocation: StorageLocation.Memory });
|
||||
account.loginRedirect = value;
|
||||
await this.saveAccount(account, options ?? { storageLocation: StorageLocation.Memory });
|
||||
}
|
||||
|
||||
async setMainWindowSize(value: number, options?: StorageOptions): Promise<void> {
|
||||
const account = await this.getAccount(options ?? { storageLocation: StorageLocation.Memory });
|
||||
account.mainWindowSize = value;
|
||||
|
||||
Reference in New Issue
Block a user