mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
[SG-859] Key and MasterPasswordHash stored on AuthRequest when you deny login request (#2469)
* [SG-856] Remove nullable from RequestApproved property * [SG-856] Assign key and hash only if approved
This commit is contained in:
parent
a504364e91
commit
16ad5db418
@ -137,11 +137,16 @@ public class AuthRequestsController : Controller
|
||||
throw new BadRequestException("Invalid device.");
|
||||
}
|
||||
|
||||
authRequest.Key = model.Key;
|
||||
authRequest.MasterPasswordHash = model.MasterPasswordHash;
|
||||
authRequest.ResponseDeviceId = device.Id;
|
||||
authRequest.ResponseDate = DateTime.UtcNow;
|
||||
authRequest.Approved = model.RequestApproved;
|
||||
|
||||
if (model.RequestApproved)
|
||||
{
|
||||
authRequest.Key = model.Key;
|
||||
authRequest.MasterPasswordHash = model.MasterPasswordHash;
|
||||
}
|
||||
|
||||
await _authRequestRepository.ReplaceAsync(authRequest);
|
||||
|
||||
// We only want to send an approval notification if the request is approved (or null),
|
||||
|
Loading…
x
Reference in New Issue
Block a user