mirror of
https://github.com/bitwarden/server.git
synced 2025-05-20 19:14:32 -05:00
user revision date updates
This commit is contained in:
parent
5de7fde685
commit
7364f1d442
@ -75,7 +75,7 @@ namespace Bit.Core.Repositories.SqlServer
|
|||||||
|
|
||||||
public virtual async Task UpsertAsync(T obj)
|
public virtual async Task UpsertAsync(T obj)
|
||||||
{
|
{
|
||||||
if(string.IsNullOrWhiteSpace(obj.Id))
|
if(string.IsNullOrWhiteSpace(obj.Id) || obj.Id == "0" || obj.Id == Guid.Empty.ToString())
|
||||||
{
|
{
|
||||||
await CreateAsync(obj);
|
await CreateAsync(obj);
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,7 @@ namespace Bit.Core.Services
|
|||||||
|
|
||||||
user.Email = newEmail;
|
user.Email = newEmail;
|
||||||
user.EmailVerified = true;
|
user.EmailVerified = true;
|
||||||
|
user.RevisionDate = DateTime.UtcNow;
|
||||||
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
||||||
return IdentityResult.Success;
|
return IdentityResult.Success;
|
||||||
}
|
}
|
||||||
@ -166,6 +167,7 @@ namespace Bit.Core.Services
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user.RevisionDate = DateTime.UtcNow;
|
||||||
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
||||||
return IdentityResult.Success;
|
return IdentityResult.Success;
|
||||||
}
|
}
|
||||||
@ -189,7 +191,7 @@ namespace Bit.Core.Services
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _userRepository.ReplaceAsync(user);
|
await SaveUserAsync(user);
|
||||||
return IdentityResult.Success;
|
return IdentityResult.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +230,7 @@ namespace Bit.Core.Services
|
|||||||
throw new ArgumentException(nameof(provider));
|
throw new ArgumentException(nameof(provider));
|
||||||
}
|
}
|
||||||
|
|
||||||
await _userRepository.ReplaceAsync(user);
|
await SaveUserAsync(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<IdentityResult> UpdatePasswordHash(User user, string newPassword, bool validatePassword = true)
|
private async Task<IdentityResult> UpdatePasswordHash(User user, string newPassword, bool validatePassword = true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user