mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
[Auto-Logout] Implement upstream changes (#506)
* Initial commit of auto logout functionality * Update jslib31a2574->28e3fff* Reverting prod URLs * Set log out expired param to false Co-authored-by: Vincent Salucci <vsalucci@bitwarden.com>
This commit is contained in:
@@ -4,16 +4,24 @@ import { ConstantsService } from 'jslib/services';
|
||||
|
||||
export class HtmlStorageService implements StorageService {
|
||||
private localStorageKeys = new Set(['appId', 'anonymousAppId', 'rememberedEmail', 'passwordGenerationOptions',
|
||||
ConstantsService.disableFaviconKey, ConstantsService.lockOptionKey, 'rememberEmail', 'enableGravatars',
|
||||
ConstantsService.localeKey, ConstantsService.lockOptionKey, ConstantsService.autoConfirmFingerprints]);
|
||||
ConstantsService.disableFaviconKey, 'rememberEmail', 'enableGravatars', ConstantsService.localeKey,
|
||||
ConstantsService.autoConfirmFingerprints, ConstantsService.vaultTimeoutKey,
|
||||
ConstantsService.vaultTimeoutActionKey]);
|
||||
private localStorageStartsWithKeys = ['twoFactorToken_', ConstantsService.collapsedGroupingsKey + '_'];
|
||||
|
||||
constructor(private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
async init() {
|
||||
const lockOption = await this.get<number>(ConstantsService.lockOptionKey);
|
||||
if (lockOption == null && !this.platformUtilsService.isDev()) {
|
||||
await this.save(ConstantsService.lockOptionKey, 15);
|
||||
// LockOption -> VaultTimeout (uses the same legacy string value for backwards compat)
|
||||
const vaultTimeout = await this.get<number>(ConstantsService.vaultTimeoutKey);
|
||||
if (vaultTimeout == null && !this.platformUtilsService.isDev()) {
|
||||
await this.save(ConstantsService.vaultTimeoutKey, 15);
|
||||
}
|
||||
|
||||
// Default Action to lock
|
||||
const vaultTimeoutAction = await this.get<string>(ConstantsService.vaultTimeoutActionKey);
|
||||
if (vaultTimeoutAction == null) {
|
||||
await this.save(ConstantsService.vaultTimeoutActionKey, 'lock');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user