mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fix forgot password pin request
This commit is contained in:
parent
f8283d8c20
commit
eb0ff0c370
@ -509,14 +509,14 @@ namespace Jellyfin.Api.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Redeems a forgot password pin.
|
/// Redeems a forgot password pin.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pin">The pin.</param>
|
/// <param name="forgotPasswordPinRequest">The forgot password pin request containing the endered pin.</param>
|
||||||
/// <response code="200">Pin reset process started.</response>
|
/// <response code="200">Pin reset process started.</response>
|
||||||
/// <returns>A <see cref="Task"/> containing a <see cref="PinRedeemResult"/>.</returns>
|
/// <returns>A <see cref="Task"/> containing a <see cref="PinRedeemResult"/>.</returns>
|
||||||
[HttpPost("ForgotPassword/Pin")]
|
[HttpPost("ForgotPassword/Pin")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
Jellyfin.Api/Models/UserDtos/ForgotPasswordPinDto.cs
Normal file
16
Jellyfin.Api/Models/UserDtos/ForgotPasswordPinDto.cs
Normal file
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user