mirror of
https://github.com/bitwarden/server
synced 2025-12-20 10:13:39 +00:00
check for keys already existing
This commit is contained in:
@@ -11,12 +11,16 @@ namespace Bit.Core.Models.Api
|
|||||||
|
|
||||||
public User ToUser(User existingUser)
|
public User ToUser(User existingUser)
|
||||||
{
|
{
|
||||||
if(!string.IsNullOrWhiteSpace(PublicKey))
|
if(string.IsNullOrWhiteSpace(existingUser.PublicKey) && !string.IsNullOrWhiteSpace(PublicKey))
|
||||||
{
|
{
|
||||||
existingUser.PublicKey = PublicKey;
|
existingUser.PublicKey = PublicKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(string.IsNullOrWhiteSpace(existingUser.PrivateKey))
|
||||||
|
{
|
||||||
existingUser.PrivateKey = EncryptedPrivateKey;
|
existingUser.PrivateKey = EncryptedPrivateKey;
|
||||||
|
}
|
||||||
|
|
||||||
return existingUser;
|
return existingUser;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user