diff options
| author | Cody Robibero <cody@robibe.ro> | 2023-05-29 18:38:01 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-29 18:38:01 -0600 |
| commit | d8f0933f335044249048e9ae0c0030ca0b780fee (patch) | |
| tree | 5b4c70ecb64de8c6260a8f13207f15c147151042 /Jellyfin.Server.Implementations | |
| parent | cfca6fc56ea56e42833ea7d46e7fb90bb7e4dce0 (diff) | |
| parent | 29ef02af9a1c2f2ff51b5cd34a9074943cdc1d1f (diff) | |
Merge pull request #9821 from cvium/admin_must_have_pw
Diffstat (limited to 'Jellyfin.Server.Implementations')
| -rw-r--r-- | Jellyfin.Server.Implementations/Users/UserManager.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index fa23fe148..1d03baa4c 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -272,6 +272,10 @@ namespace Jellyfin.Server.Implementations.Users public 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); |
