From d92c6cc6c60597a7408892972e90192883b64b24 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 27 Dec 2017 15:39:31 -0500 Subject: [PATCH] always locked if not running in memory --- src/App/Services/LockService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App/Services/LockService.cs b/src/App/Services/LockService.cs index f5215a627..2439e5005 100644 --- a/src/App/Services/LockService.cs +++ b/src/App/Services/LockService.cs @@ -18,6 +18,7 @@ namespace Bit.App.Services private readonly IAuthService _authService; private readonly IFingerprint _fingerprint; private bool _timerCreated = false; + private bool _firstLockCheck = true; public LockService( ISettings settings, @@ -45,6 +46,10 @@ namespace Bit.App.Services public async Task GetLockTypeAsync(bool forceLock) { + // Always locked if not already running in memory. + var firstlockCheck = _firstLockCheck; + _firstLockCheck = false; + // Only lock if they are logged in if(!_authService.IsAuthenticated) { @@ -52,7 +57,7 @@ namespace Bit.App.Services } // Are we forcing a lock? (i.e. clicking a button to lock the app manually, immediately) - if(!forceLock && !_appSettings.Locked) + if(!firstlockCheck && !forceLock && !_appSettings.Locked) { // Lock seconds tells if they want to lock the app or not var lockSeconds = _settings.GetValueOrDefault(Constants.SettingLockSeconds, 60 * 15);