mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 07:43:37 +00:00
[PM-2713] rename toggle method, don't reset enc user key
This commit is contained in:
@@ -491,7 +491,7 @@ namespace Bit.App.Pages
|
|||||||
await _stateService.SetBiometricUnlockAsync(null);
|
await _stateService.SetBiometricUnlockAsync(null);
|
||||||
}
|
}
|
||||||
await _stateService.SetBiometricLockedAsync(false);
|
await _stateService.SetBiometricLockedAsync(false);
|
||||||
await _cryptoService.ToggleKeysAsync();
|
await _cryptoService.RefreshKeysAsync();
|
||||||
BuildList();
|
BuildList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Bit.Core.Abstractions
|
|||||||
public interface ICryptoService
|
public interface ICryptoService
|
||||||
{
|
{
|
||||||
void ClearCache();
|
void ClearCache();
|
||||||
Task ToggleKeysAsync();
|
Task RefreshKeysAsync();
|
||||||
Task SetUserKeyAsync(UserKey userKey, string userId = null);
|
Task SetUserKeyAsync(UserKey userKey, string userId = null);
|
||||||
Task<UserKey> GetUserKeyAsync(string userId = null);
|
Task<UserKey> GetUserKeyAsync(string userId = null);
|
||||||
Task<UserKey> GetUserKeyWithLegacySupportAsync(string userId = null);
|
Task<UserKey> GetUserKeyWithLegacySupportAsync(string userId = null);
|
||||||
|
|||||||
@@ -43,15 +43,10 @@ namespace Bit.Core.Services
|
|||||||
_orgKeys = null;
|
_orgKeys = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ToggleKeysAsync()
|
public async Task RefreshKeysAsync()
|
||||||
{
|
{
|
||||||
// refresh or clear the pin key
|
// refresh or clear the pin key
|
||||||
await SetUserKeyAsync(await GetUserKeyAsync());
|
await SetUserKeyAsync(await GetUserKeyAsync());
|
||||||
|
|
||||||
// refresh or clear the encrypted user key
|
|
||||||
var encUserKey = await _stateService.GetUserKeyMasterKeyAsync();
|
|
||||||
await _stateService.SetUserKeyMasterKeyAsync(null);
|
|
||||||
await _stateService.SetUserKeyMasterKeyAsync(encUserKey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task SetUserKeyAsync(UserKey userKey, string userId = null)
|
public async Task SetUserKeyAsync(UserKey userKey, string userId = null)
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ namespace Bit.Core.Services
|
|||||||
{
|
{
|
||||||
await _stateService.SetVaultTimeoutAsync(timeout);
|
await _stateService.SetVaultTimeoutAsync(timeout);
|
||||||
await _stateService.SetVaultTimeoutActionAsync(action);
|
await _stateService.SetVaultTimeoutActionAsync(action);
|
||||||
await _cryptoService.ToggleKeysAsync();
|
await _cryptoService.RefreshKeysAsync();
|
||||||
await _tokenService.ToggleTokensAsync();
|
await _tokenService.ToggleTokensAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user