feat: enable copying of TOTP code when auto filling credentials (#278)
* feat: Help enable copying of TOTP code when auto filling credentials * fix: Update constant to stay consistent
This commit is contained in:
parent
e2cb9b6bef
commit
2841cff90a
|
@ -2,4 +2,5 @@ export abstract class TotpService {
|
||||||
getCode: (key: string) => Promise<string>;
|
getCode: (key: string) => Promise<string>;
|
||||||
getTimeInterval: (key: string) => number;
|
getTimeInterval: (key: string) => number;
|
||||||
isAutoCopyEnabled: () => Promise<boolean>;
|
isAutoCopyEnabled: () => Promise<boolean>;
|
||||||
|
isAutoCopyOnAutoFillEnabled: () => Promise<boolean>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ export class ConstantsService {
|
||||||
static readonly disableBadgeCounterKey: string = 'disableBadgeCounter';
|
static readonly disableBadgeCounterKey: string = 'disableBadgeCounter';
|
||||||
static readonly disableAutoTotpCopyKey: string = 'disableAutoTotpCopy';
|
static readonly disableAutoTotpCopyKey: string = 'disableAutoTotpCopy';
|
||||||
static readonly enableAutoFillOnPageLoadKey: string = 'enableAutoFillOnPageLoad';
|
static readonly enableAutoFillOnPageLoadKey: string = 'enableAutoFillOnPageLoad';
|
||||||
|
static readonly enableAutoTotpCopyOnAutoFillKey: string = 'enableAutoTotpCopyOnAutoFillKey';
|
||||||
static readonly vaultTimeoutKey: string = 'lockOption';
|
static readonly vaultTimeoutKey: string = 'lockOption';
|
||||||
static readonly vaultTimeoutActionKey: string = 'vaultTimeoutAction';
|
static readonly vaultTimeoutActionKey: string = 'vaultTimeoutAction';
|
||||||
static readonly lastActiveKey: string = 'lastActive';
|
static readonly lastActiveKey: string = 'lastActive';
|
||||||
|
@ -39,6 +40,7 @@ export class ConstantsService {
|
||||||
readonly disableBadgeCounterKey: string = ConstantsService.disableBadgeCounterKey;
|
readonly disableBadgeCounterKey: string = ConstantsService.disableBadgeCounterKey;
|
||||||
readonly disableAutoTotpCopyKey: string = ConstantsService.disableAutoTotpCopyKey;
|
readonly disableAutoTotpCopyKey: string = ConstantsService.disableAutoTotpCopyKey;
|
||||||
readonly enableAutoFillOnPageLoadKey: string = ConstantsService.enableAutoFillOnPageLoadKey;
|
readonly enableAutoFillOnPageLoadKey: string = ConstantsService.enableAutoFillOnPageLoadKey;
|
||||||
|
readonly enableAutoTotpCopyOnAutoFillKey: string = ConstantsService.enableAutoTotpCopyOnAutoFillKey;
|
||||||
readonly vaultTimeoutKey: string = ConstantsService.vaultTimeoutKey;
|
readonly vaultTimeoutKey: string = ConstantsService.vaultTimeoutKey;
|
||||||
readonly vaultTimeoutActionKey: string = ConstantsService.vaultTimeoutActionKey;
|
readonly vaultTimeoutActionKey: string = ConstantsService.vaultTimeoutActionKey;
|
||||||
readonly lastActiveKey: string = ConstantsService.lastActiveKey;
|
readonly lastActiveKey: string = ConstantsService.lastActiveKey;
|
||||||
|
|
|
@ -109,6 +109,10 @@ export class TotpService implements TotpServiceAbstraction {
|
||||||
return !(await this.storageService.get<boolean>(ConstantsService.disableAutoTotpCopyKey));
|
return !(await this.storageService.get<boolean>(ConstantsService.disableAutoTotpCopyKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async isAutoCopyOnAutoFillEnabled(): Promise<boolean> {
|
||||||
|
return await this.storageService.get<boolean>(ConstantsService.enableAutoTotpCopyOnAutoFillKey);
|
||||||
|
}
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
private leftPad(s: string, l: number, p: string): string {
|
private leftPad(s: string, l: number, p: string): string {
|
||||||
|
|
Loading…
Reference in New Issue