The Free Software Media System - Server Backend & API
refactor: admin users must have a non-empty password
cvium57d8452e2a09
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.csindex c4756433e0..04c3d8a70d 100644--- a/Jellyfin.Server.Implementations/Users/UserManager.cs+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs@@ -278,6 +278,10 @@ namespace Jellyfin.Server.Implementations.Userspublic async Task ChangePassword(User user, string newPassword){ArgumentNullException.ThrowIfNull(user);+ if (user.HasPermission(PermissionKind.IsAdministrator) && string.IsNullOrWhiteSpace(newPassword))+ {+ throw new ArgumentException("Admin user passwords must not be empty", nameof(newPassword));+ }await GetAuthenticationProvider(user).ChangePassword(user, newPassword).ConfigureAwait(false);await UpdateUserAsync(user).ConfigureAwait(false);