From aa1e5a11ad2c3887ec13ada612c93a04fc44ee77 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Sat, 25 Apr 2020 08:13:30 -0500 Subject: [PATCH] [Auto Logout] Added warning dialog for log out action (#518) * Added warning dialog for log out timeout action * Reverting testing service module endpoints --- src/app/settings/options.component.ts | 9 +++++++++ src/locales/en/messages.json | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/app/settings/options.component.ts b/src/app/settings/options.component.ts index d3882860463..8c33388618f 100644 --- a/src/app/settings/options.component.ts +++ b/src/app/settings/options.component.ts @@ -70,6 +70,15 @@ export class OptionsComponent implements OnInit { } async submit() { + if (this.vaultTimeoutAction === 'logOut') { + const confirmed = await this.platformUtilsService.showDialog( + this.i18nService.t('vaultTimeoutLogOutConfirmation'), + this.i18nService.t('vaultTimeoutLogOutConfirmationTitle'), + this.i18nService.t('yes'), this.i18nService.t('cancel'), 'warning'); + if (!confirmed) { + return; + } + } await this.vaultTimeoutService.setVaultTimeoutOptions(this.vaultTimeout != null ? this.vaultTimeout : null, this.vaultTimeoutAction); await this.storageService.save(ConstantsService.disableFaviconKey, this.disableIcons); diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index c3251097d3e..3bd7ce2e282 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -3053,5 +3053,11 @@ "lock": { "message": "Lock", "description": "Verb form: to make secure or inaccesible by" + }, + "vaultTimeoutLogOutConfirmation": { + "message": "Logging out will remove all access to your vault and requires online authentication after the timeout period. Are you sure you want to use this setting?" + }, + "vaultTimeoutLogOutConfirmationTitle": { + "message": "Timeout Action Confirmation" } }