mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
[SG-763] Store the fact that a Passwordless request was denied in the AuthRequest table (#2363)
* Added migrations for sqlserver and mysql * Added migrations for postgres * renamed mysql migration script to make naming uniform * introduced approved field to the update auth request controller;This change would keep track of denied passwordless requests * Recreated the authRequestView, introduced the approved field to the create procedure and updated the response model * Formatted code * fixed incorrect syntax in the AuthRequest_Create.sql SP
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Reflection;
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Api;
|
||||
|
||||
namespace Bit.Api.Models.Response;
|
||||
@ -25,8 +24,7 @@ public class AuthRequestResponseModel : ResponseModel
|
||||
Key = authRequest.Key;
|
||||
MasterPasswordHash = authRequest.MasterPasswordHash;
|
||||
CreationDate = authRequest.CreationDate;
|
||||
RequestApproved = !string.IsNullOrWhiteSpace(Key) &&
|
||||
(authRequest.Type == AuthRequestType.Unlock || !string.IsNullOrWhiteSpace(MasterPasswordHash));
|
||||
RequestApproved = authRequest.Approved ?? false;
|
||||
Origin = new Uri(vaultUri).Host;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user