more lock service logging
This commit is contained in:
parent
d1eec27fae
commit
d64625aba2
|
@ -116,13 +116,18 @@ 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)
|
||||||
{
|
{
|
||||||
|
logService.Info("LockAsync 2");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
logService.Info("LockAsync 3");
|
||||||
if(allowSoftLock)
|
if(allowSoftLock)
|
||||||
{
|
{
|
||||||
|
logService.Info("LockAsync 4");
|
||||||
var pinSet = await IsPinLockSetAsync();
|
var pinSet = await IsPinLockSetAsync();
|
||||||
if(pinSet.Item1)
|
if(pinSet.Item1)
|
||||||
{
|
{
|
||||||
|
@ -134,11 +139,13 @@ namespace Bit.Core.Services
|
||||||
}
|
}
|
||||||
if(FingerprintLocked || PinLocked)
|
if(FingerprintLocked || PinLocked)
|
||||||
{
|
{
|
||||||
|
logService.Info("LockAsync 5");
|
||||||
_messagingService.Send("locked", userInitiated);
|
_messagingService.Send("locked", userInitiated);
|
||||||
// TODO: locked callback?
|
// TODO: locked callback?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
logService.Info("LockAsync 6");
|
||||||
await Task.WhenAll(
|
await Task.WhenAll(
|
||||||
_cryptoService.ClearKeyAsync(),
|
_cryptoService.ClearKeyAsync(),
|
||||||
_cryptoService.ClearOrgKeysAsync(true),
|
_cryptoService.ClearOrgKeysAsync(true),
|
||||||
|
@ -151,6 +158,7 @@ namespace Bit.Core.Services
|
||||||
_searchService.ClearIndex();
|
_searchService.ClearIndex();
|
||||||
_messagingService.Send("locked", userInitiated);
|
_messagingService.Send("locked", userInitiated);
|
||||||
// TODO: locked callback?
|
// TODO: locked callback?
|
||||||
|
logService.Info("LockAsync 7");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task SetLockOptionAsync(int? lockOption)
|
public async Task SetLockOptionAsync(int? lockOption)
|
||||||
|
|
Loading…
Reference in New Issue