1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-15 23:13:25 +00:00

[PM-2293] Remove userid params

This commit is contained in:
André Bispo
2023-07-25 17:39:57 +01:00
parent 13a46fae5a
commit 28addfeb43
2 changed files with 8 additions and 6 deletions

View File

@@ -33,14 +33,12 @@ namespace Bit.Core.Services
public async Task<SymmetricCryptoKey> GetDeviceKeyAsync()
{
var activeUserId = await _stateService.GetActiveUserIdAsync();
return await _stateService.GetDeviceKeyAsync(activeUserId);
return await _stateService.GetDeviceKeyAsync();
}
private async Task SetDeviceKeyAsync(SymmetricCryptoKey deviceKey)
{
var activeUserId = await _stateService.GetActiveUserIdAsync();
await _stateService.SetDeviceKeyAsync(deviceKey, activeUserId);
await _stateService.SetDeviceKeyAsync(deviceKey);
}
public async Task<DeviceResponse> TrustDeviceAsync()

View File

@@ -515,7 +515,9 @@ namespace Bit.Core.Services
public async Task<SymmetricCryptoKey> GetDeviceKeyAsync(string userId = null)
{
var deviceKeyB64 = await _storageMediatorService.GetAsync<string>(Constants.DeviceKeyKey(userId), true);
var reconciledOptions = ReconcileOptions(new StorageOptions { UserId = userId },
await GetDefaultStorageOptionsAsync());
var deviceKeyB64 = await _storageMediatorService.GetAsync<string>(Constants.DeviceKeyKey(reconciledOptions.UserId), true);
if (string.IsNullOrEmpty(deviceKeyB64))
{
return null;
@@ -525,7 +527,9 @@ namespace Bit.Core.Services
public async Task SetDeviceKeyAsync(SymmetricCryptoKey value, string userId = null)
{
await _storageMediatorService.SaveAsync(Constants.DeviceKeyKey(userId), value.KeyB64, true);
var reconciledOptions = ReconcileOptions(new StorageOptions { UserId = userId },
await GetDefaultStorageOptionsAsync());
await _storageMediatorService.SaveAsync(Constants.DeviceKeyKey(reconciledOptions.UserId), value.KeyB64, true);
}
public async Task<List<string>> GetAutofillBlacklistedUrisAsync(string userId = null)