diff --git a/src/Api/Controllers/DevicesController.cs b/src/Api/Controllers/DevicesController.cs index 6787fe515c..46e312bc03 100644 --- a/src/Api/Controllers/DevicesController.cs +++ b/src/Api/Controllers/DevicesController.cs @@ -1,4 +1,4 @@ -using Api.Models.Request; +using System.ComponentModel.DataAnnotations; using Bit.Api.Auth.Models.Request; using Bit.Api.Auth.Models.Request.Accounts; using Bit.Api.Models.Request; @@ -207,8 +207,10 @@ public class DevicesController : Controller [AllowAnonymous] [HttpGet("knowndevice")] - public async Task GetByIdentifierQuery([FromHeader] KnownDeviceRequestModel request) - => await GetByIdentifier(CoreHelpers.Base64UrlDecodeString(request.Email), request.DeviceIdentifier); + public async Task GetByIdentifierQuery( + [Required][FromHeader(Name = "X-Request-Email")] string Email, + [Required][FromHeader(Name = "X-Device-Identifier")] string DeviceIdentifier) + => await GetByIdentifier(CoreHelpers.Base64UrlDecodeString(Email), DeviceIdentifier); [Obsolete("Path is deprecated due to encoding issues, use /knowndevice instead.")] [AllowAnonymous] diff --git a/src/Api/Models/Request/KnownDeviceRequestModel.cs b/src/Api/Models/Request/KnownDeviceRequestModel.cs deleted file mode 100644 index 8232f596af..0000000000 --- a/src/Api/Models/Request/KnownDeviceRequestModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Mvc; - -namespace Api.Models.Request; - -public class KnownDeviceRequestModel -{ - [Required] - [FromHeader(Name = "X-Request-Email")] - public string Email { get; set; } - - [Required] - [FromHeader(Name = "X-Device-Identifier")] - public string DeviceIdentifier { get; set; } - -}