mirror of
https://github.com/bitwarden/server.git
synced 2025-02-10 00:51:22 +01:00
check to make sure user actually needs key update
This commit is contained in:
parent
6d22356caf
commit
cf6334e37d
@ -456,6 +456,11 @@ namespace Bit.Core.Services
|
|||||||
|
|
||||||
if(await CheckPasswordAsync(user, masterPassword))
|
if(await CheckPasswordAsync(user, masterPassword))
|
||||||
{
|
{
|
||||||
|
if(user.Key != null)
|
||||||
|
{
|
||||||
|
throw new BadRequestException("User already has an updated encryption key.");
|
||||||
|
}
|
||||||
|
|
||||||
user.RevisionDate = user.AccountRevisionDate = DateTime.UtcNow;
|
user.RevisionDate = user.AccountRevisionDate = DateTime.UtcNow;
|
||||||
user.SecurityStamp = Guid.NewGuid().ToString();
|
user.SecurityStamp = Guid.NewGuid().ToString();
|
||||||
user.Key = key;
|
user.Key = key;
|
||||||
|
Loading…
Reference in New Issue
Block a user