1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-06 09:10:50 +01:00

more lock service logging

This commit is contained in:
Kyle Spearrin 2019-06-03 16:07:45 -04:00
parent d1eec27fae
commit d64625aba2

View File

@ -116,13 +116,18 @@ namespace Bit.Core.Services
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();
if(!authed)
{
logService.Info("LockAsync 2");
return;
}
logService.Info("LockAsync 3");
if(allowSoftLock)
{
logService.Info("LockAsync 4");
var pinSet = await IsPinLockSetAsync();
if(pinSet.Item1)
{
@ -134,11 +139,13 @@ namespace Bit.Core.Services
}
if(FingerprintLocked || PinLocked)
{
logService.Info("LockAsync 5");
_messagingService.Send("locked", userInitiated);
// TODO: locked callback?
return;
}
}
logService.Info("LockAsync 6");
await Task.WhenAll(
_cryptoService.ClearKeyAsync(),
_cryptoService.ClearOrgKeysAsync(true),
@ -151,6 +158,7 @@ namespace Bit.Core.Services
_searchService.ClearIndex();
_messagingService.Send("locked", userInitiated);
// TODO: locked callback?
logService.Info("LockAsync 7");
}
public async Task SetLockOptionAsync(int? lockOption)