mirror of
https://github.com/bitwarden/jslib
synced 2025-12-22 03:03:15 +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>;
|
getLegacyEtmKey: (options?: StorageOptions) => Promise<SymmetricCryptoKey>;
|
||||||
getLocalData: (options?: StorageOptions) => Promise<any>;
|
getLocalData: (options?: StorageOptions) => Promise<any>;
|
||||||
getLocale: (options?: StorageOptions) => Promise<string>;
|
getLocale: (options?: StorageOptions) => Promise<string>;
|
||||||
|
getLoginRedirect: (options?: StorageOptions) => Promise<any>;
|
||||||
getMainWindowSize: (options?: StorageOptions) => Promise<number>;
|
getMainWindowSize: (options?: StorageOptions) => Promise<number>;
|
||||||
getMinimizeOnCopyToClipboard: (options?: StorageOptions) => Promise<boolean>;
|
getMinimizeOnCopyToClipboard: (options?: StorageOptions) => Promise<boolean>;
|
||||||
getNeverDomains: (options?: StorageOptions) => Promise<{ [id: string]: any }>;
|
getNeverDomains: (options?: StorageOptions) => Promise<{ [id: string]: any }>;
|
||||||
@@ -213,6 +214,7 @@ export abstract class StateService {
|
|||||||
setLegacyEtmKey: (value: SymmetricCryptoKey, options?: StorageOptions) => Promise<void>;
|
setLegacyEtmKey: (value: SymmetricCryptoKey, options?: StorageOptions) => Promise<void>;
|
||||||
setLocalData: (value: string, options?: StorageOptions) => Promise<void>;
|
setLocalData: (value: string, options?: StorageOptions) => Promise<void>;
|
||||||
setLocale: (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>;
|
setMainWindowSize: (value: number, options?: StorageOptions) => Promise<void>;
|
||||||
setMinimizeOnCopyToClipboard: (value: boolean, options?: StorageOptions) => Promise<void>;
|
setMinimizeOnCopyToClipboard: (value: boolean, options?: StorageOptions) => Promise<void>;
|
||||||
setNeverDomains: (value: { [id: string]: any }, options?: StorageOptions) => Promise<void>;
|
setNeverDomains: (value: { [id: string]: any }, options?: StorageOptions) => Promise<void>;
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ export class Account {
|
|||||||
lastSync: string;
|
lastSync: string;
|
||||||
legacyEtmKey: SymmetricCryptoKey;
|
legacyEtmKey: SymmetricCryptoKey;
|
||||||
localData: any;
|
localData: any;
|
||||||
|
loginRedirect: any;
|
||||||
mainWindowSize: number;
|
mainWindowSize: number;
|
||||||
minimizeOnCopyToClipboard: boolean;
|
minimizeOnCopyToClipboard: boolean;
|
||||||
neverDomains: string[];
|
neverDomains: string[];
|
||||||
|
|||||||
@@ -340,6 +340,10 @@ export class StateService implements StateServiceAbstraction {
|
|||||||
return (await this.getAccount(options ?? { storageLocation: StorageLocation.Memory }))?.locale;
|
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> {
|
async getMainWindowSize(options?: StorageOptions): Promise<number> {
|
||||||
return (await this.getAccount(options ?? { storageLocation: StorageLocation.Memory }))?.mainWindowSize;
|
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 });
|
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> {
|
async setMainWindowSize(value: number, options?: StorageOptions): Promise<void> {
|
||||||
const account = await this.getAccount(options ?? { storageLocation: StorageLocation.Memory });
|
const account = await this.getAccount(options ?? { storageLocation: StorageLocation.Memory });
|
||||||
account.mainWindowSize = value;
|
account.mainWindowSize = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user