Merge pull request #8013 from daullmer/parental_password_fix

pull/8086/head
Bond-009 2 years ago committed by GitHub
commit 84a1674f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -282,16 +282,19 @@ namespace Jellyfin.Api.Controllers
}
else
{
var success = await _userManager.AuthenticateUser(
user.Username,
request.CurrentPw,
request.CurrentPw,
HttpContext.GetNormalizedRemoteIp().ToString(),
false).ConfigureAwait(false);
if (success == null)
if (!HttpContext.User.IsInRole(UserRoles.Administrator))
{
return StatusCode(StatusCodes.Status403Forbidden, "Invalid user or password entered.");
var success = await _userManager.AuthenticateUser(
user.Username,
request.CurrentPw,
request.CurrentPw,
HttpContext.GetNormalizedRemoteIp().ToString(),
false).ConfigureAwait(false);
if (success == null)
{
return StatusCode(StatusCodes.Status403Forbidden, "Invalid user or password entered.");
}
}
await _userManager.ChangePassword(user, request.NewPw).ConfigureAwait(false);

Loading…
Cancel
Save