mirror of
https://github.com/bitwarden/server.git
synced 2025-05-22 12:04:27 -05:00
check for keys already existing
This commit is contained in:
parent
5a24b6624d
commit
63e95f0f55
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
existingUser.PrivateKey = EncryptedPrivateKey;
|
if(string.IsNullOrWhiteSpace(existingUser.PrivateKey))
|
||||||
|
{
|
||||||
|
existingUser.PrivateKey = EncryptedPrivateKey;
|
||||||
|
}
|
||||||
|
|
||||||
return existingUser;
|
return existingUser;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user