diff --git a/src/Api/Auth/Models/Response/PendingAuthRequestResponseModel.cs b/src/Api/Auth/Models/Response/PendingAuthRequestResponseModel.cs index e7bfc3f974..8428593068 100644 --- a/src/Api/Auth/Models/Response/PendingAuthRequestResponseModel.cs +++ b/src/Api/Auth/Models/Response/PendingAuthRequestResponseModel.cs @@ -8,8 +8,8 @@ public class PendingAuthRequestResponseModel : AuthRequestResponseModel : base(authRequest, vaultUri, obj) { ArgumentNullException.ThrowIfNull(authRequest); - RequestingDeviceId = authRequest.DeviceId; + RequestDeviceId = authRequest.RequestDeviceId; } - public Guid? RequestingDeviceId { get; set; } + public Guid? RequestDeviceId { get; set; } } diff --git a/src/Core/Auth/Models/Data/PendingAuthRequestDetails.cs b/src/Core/Auth/Models/Data/PendingAuthRequestDetails.cs index 5229a97aea..0b28af0e8b 100644 --- a/src/Core/Auth/Models/Data/PendingAuthRequestDetails.cs +++ b/src/Core/Auth/Models/Data/PendingAuthRequestDetails.cs @@ -7,7 +7,7 @@ namespace Bit.Core.Auth.Models.Data; public class PendingAuthRequestDetails : AuthRequest { - public Guid? DeviceId { get; set; } + public Guid? RequestDeviceId { get; set; } /** * Constructor for EF response. @@ -35,16 +35,17 @@ public class PendingAuthRequestDetails : AuthRequest CreationDate = authRequest.CreationDate; ResponseDate = authRequest.ResponseDate; AuthenticationDate = authRequest.AuthenticationDate; - DeviceId = deviceId; + RequestDeviceId = deviceId; } /** * Constructor for dapper response. * Note: if the DeviceId is null it comes back as an empty guid That could change if the stored - * procedure runs on a different kind of db. - * In order to maintain the flexibility of the wildcard * in SQL the constrctor accepts a long "row number rn" - * parameter that was used to order the results in the SQL query. Also SQL complains about the constructor not - * having the same parameters as the SELECT statement. + * procedure runs on a different database provider. + * In order to maintain the flexibility of the wildcard (*) in SQL, the constructor accepts a"row number" rn of type long + * parameter. 'rn' was used to order the results in the SQL query. Also, SQL complains about the constructor not + * having the same parameters as the SELECT statement and since the SELECT uses the wildcard we need to include everything. + * Order matters when mapping from the Stored Procedure, so the columns are in the order they come back from the query. */ public PendingAuthRequestDetails( Guid id, @@ -69,12 +70,10 @@ public class PendingAuthRequestDetails : AuthRequest { Id = id; UserId = userId; - OrganizationId = organizationId; Type = (AuthRequestType)type; RequestDeviceIdentifier = requestDeviceIdentifier; RequestDeviceType = (DeviceType)requestDeviceType; RequestIpAddress = requestIpAddress; - RequestCountryName = requestCountryName; ResponseDeviceId = responseDeviceId; AccessCode = accessCode; PublicKey = publicKey; @@ -84,6 +83,8 @@ public class PendingAuthRequestDetails : AuthRequest CreationDate = creationDate; ResponseDate = responseDate; AuthenticationDate = authenticationDate; - DeviceId = deviceId; + OrganizationId = organizationId; + RequestCountryName = requestCountryName; + RequestDeviceId = deviceId; } } diff --git a/src/Infrastructure.EntityFramework/Auth/Repositories/AuthRequestRepository.cs b/src/Infrastructure.EntityFramework/Auth/Repositories/AuthRequestRepository.cs index 3037e70b8c..34f95da9c5 100644 --- a/src/Infrastructure.EntityFramework/Auth/Repositories/AuthRequestRepository.cs +++ b/src/Infrastructure.EntityFramework/Auth/Repositories/AuthRequestRepository.cs @@ -77,7 +77,7 @@ public class AuthRequestRepository : Repository