1
0
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:
Jacob Fink
2023-07-31 12:57:50 -04:00
parent bb5a7383a8
commit c2ddbb7eff
4 changed files with 4 additions and 9 deletions

View File

@@ -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();
} }

View File

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

View File

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

View File

@@ -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();
} }