浏览代码

Merge pull request #5171 from Ullmie02/reset-fix

(cherry picked from commit 34e10622c6851616bd5cbb463d9704cc478c82ed)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
Bond-009 4 年之前
父节点
当前提交
39b0d69786
共有 2 个文件被更改,包括 19 次插入3 次删除
  1. 3 3
      Jellyfin.Api/Controllers/UserController.cs
  2. 16 0
      Jellyfin.Api/Models/UserDtos/ForgotPasswordPinDto.cs

+ 3 - 3
Jellyfin.Api/Controllers/UserController.cs

@@ -509,14 +509,14 @@ namespace Jellyfin.Api.Controllers
         /// <summary>
         /// Redeems a forgot password pin.
         /// </summary>
-        /// <param name="pin">The pin.</param>
+        /// <param name="forgotPasswordPinRequest">The forgot password pin request containing the entered pin.</param>
         /// <response code="200">Pin reset process started.</response>
         /// <returns>A <see cref="Task"/> containing a <see cref="PinRedeemResult"/>.</returns>
         [HttpPost("ForgotPassword/Pin")]
         [ProducesResponseType(StatusCodes.Status200OK)]
-        public async Task<ActionResult<PinRedeemResult>> ForgotPasswordPin([FromBody, Required] string pin)
+        public async Task<ActionResult<PinRedeemResult>> ForgotPasswordPin([FromBody, Required] ForgotPasswordPinDto forgotPasswordPinRequest)
         {
-            var result = await _userManager.RedeemPasswordResetPin(pin).ConfigureAwait(false);
+            var result = await _userManager.RedeemPasswordResetPin(forgotPasswordPinRequest.Pin).ConfigureAwait(false);
             return result;
         }
 

+ 16 - 0
Jellyfin.Api/Models/UserDtos/ForgotPasswordPinDto.cs

@@ -0,0 +1,16 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Jellyfin.Api.Models.UserDtos
+{
+    /// <summary>
+    /// Forgot Password Pin enter request body DTO.
+    /// </summary>
+    public class ForgotPasswordPinDto
+    {
+        /// <summary>
+        /// Gets or sets the entered pin to have the password reset.
+        /// </summary>
+        [Required]
+        public string? Pin { get; set; }
+    }
+}