mirror of
https://github.com/bitwarden/mobile
synced 2025-12-19 01:33:22 +00:00
[PM-2713] set decrypt and set user key in login helper
This commit is contained in:
@@ -470,10 +470,6 @@ namespace Bit.Core.Services
|
||||
_messagingService.Send("accountAdded");
|
||||
if (_setCryptoKeys)
|
||||
{
|
||||
if (masterKey != null)
|
||||
{
|
||||
await _cryptoService.SetMasterKeyAsync(masterKey);
|
||||
}
|
||||
|
||||
if (localHashedPassword != null)
|
||||
{
|
||||
@@ -489,6 +485,13 @@ namespace Bit.Core.Services
|
||||
|
||||
await _cryptoService.SetMasterKeyEncryptedUserKeyAsync(tokenResponse.Key);
|
||||
|
||||
if (masterKey != null)
|
||||
{
|
||||
await _cryptoService.SetMasterKeyAsync(masterKey);
|
||||
var userKey = await _cryptoService.DecryptUserKeyWithMasterKeyAsync(masterKey);
|
||||
await _cryptoService.SetUserKeyAsync(userKey);
|
||||
}
|
||||
|
||||
// User doesn't have a key pair yet (old account), let's generate one for them.
|
||||
if (tokenResponse.PrivateKey == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user