more logging

This commit is contained in:
Kyle Spearrin 2019-06-03 16:43:57 -04:00
parent d0b8c2c4bf
commit 07bc425046

View file

@ -109,6 +109,8 @@ namespace Bit.Core.Services
public async Task LockAsync(bool allowSoftLock = false, bool userInitiated = false) public async Task LockAsync(bool allowSoftLock = false, bool userInitiated = false)
{ {
var logService = ServiceContainer.Resolve<ILogService>("logService");
logService.Info("LockAsync 1");
var authed = await _userService.IsAuthenticatedAsync(); var authed = await _userService.IsAuthenticatedAsync();
if(!authed) if(!authed)
{ {
@ -116,24 +118,27 @@ namespace Bit.Core.Services
} }
if(allowSoftLock) if(allowSoftLock)
{ {
logService.Info("LockAsync 2");
var pinSet = await IsPinLockSetAsync(); var pinSet = await IsPinLockSetAsync();
if(pinSet.Item1) if(pinSet.Item1)
{ {
var logService = ServiceContainer.Resolve<ILogService>("logService");
logService.Info("LockAsync PinLocked = true"); logService.Info("LockAsync PinLocked = true");
PinLocked = true; PinLocked = true;
} }
if(await IsFingerprintLockSetAsync()) if(await IsFingerprintLockSetAsync())
{ {
logService.Info("LockAsync 3");
FingerprintLocked = true; FingerprintLocked = true;
} }
if(FingerprintLocked || PinLocked) if(FingerprintLocked || PinLocked)
{ {
logService.Info("LockAsync 4");
_messagingService.Send("locked", userInitiated); _messagingService.Send("locked", userInitiated);
// TODO: locked callback? // TODO: locked callback?
return; return;
} }
} }
logService.Info("LockAsync 5");
await Task.WhenAll( await Task.WhenAll(
_cryptoService.ClearKeyAsync(), _cryptoService.ClearKeyAsync(),
_cryptoService.ClearOrgKeysAsync(true), _cryptoService.ClearOrgKeysAsync(true),