The Free Software Media System - Server Backend & API
Backport pull request #8013 from jellyfin/release-10.8.z
Joshua Bonifaceb7206b4816b5
diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.csindex 6d15d91858..82c8563a80 100644--- a/Jellyfin.Api/Controllers/UserController.cs+++ b/Jellyfin.Api/Controllers/UserController.cs@@ -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);