diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-02-06 18:56:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-06 18:56:36 +0100 |
| commit | 34e10622c6851616bd5cbb463d9704cc478c82ed (patch) | |
| tree | 3de14ef9cc269e12bc19857248820285ab85230f | |
| parent | f8283d8c207cd816dc16768fe0cb454e1732a963 (diff) | |
| parent | 07f1a2c2dcad7890f19591ccd14d43cbc0e51e95 (diff) | |
Merge pull request #5171 from Ullmie02/reset-fix
| -rw-r--r-- | Jellyfin.Api/Controllers/UserController.cs | 6 | ||||
| -rw-r--r-- | Jellyfin.Api/Models/UserDtos/ForgotPasswordPinDto.cs | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.cs index 87a4ffd92..43ee309b7 100644 --- a/Jellyfin.Api/Controllers/UserController.cs +++ b/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; } diff --git a/Jellyfin.Api/Models/UserDtos/ForgotPasswordPinDto.cs b/Jellyfin.Api/Models/UserDtos/ForgotPasswordPinDto.cs new file mode 100644 index 000000000..62780e23c --- /dev/null +++ b/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; } + } +} |
