always locked if not running in memory

This commit is contained in:
Kyle Spearrin 2017-12-27 15:39:31 -05:00
parent 488485da54
commit d92c6cc6c6
1 changed files with 6 additions and 1 deletions

View File

@ -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<LockType> 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);