The Free Software Media System - Server Backend & API
Merge remote-tracking branch 'upstream/master' into easypassword
crobiberof4d8e0e20cca
diff --cc Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.csindex 9c5056a6b7,94b582cdef..9e1183c765--- a/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs+++ b/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs@@@ -111,5 -117,29 +117,32 @@@ namespace Jellyfin.Server.Implementatioreturn Task.CompletedTask;}++<<<<<<< HEAD++=======++ /// <inheritdoc />+ public void ChangeEasyPassword(User user, string newPassword, string newPasswordHash)+ {+ if (newPassword != null)+ {+ newPasswordHash = _cryptographyProvider.CreatePasswordHash(newPassword).ToString();+ }++ if (string.IsNullOrWhiteSpace(newPasswordHash))+ {+ throw new ArgumentNullException(nameof(newPasswordHash));+ }++ user.EasyPassword = newPasswordHash;+ }++ /// <inheritdoc />+ public string? GetEasyPasswordHash(User user)+ {+ return string.IsNullOrEmpty(user.EasyPassword)+ ? null+ : Hex.Encode(PasswordHash.Parse(user.EasyPassword).Hash);+ }++>>>>>>> upstream/master}}diff --cc Jellyfin.Server.Implementations/Users/UserManager.csindex 35ec78f5c5,9041147588..97ea03596d--- a/Jellyfin.Server.Implementations/Users/UserManager.cs+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs@@@ -260,9 -261,9 +261,9 @@@ namespace Jellyfin.Server.Implementatio}/// <inheritdoc/>- public void ChangeEasyPassword(User user, string newPassword, string newPasswordSha1)+ public void ChangeEasyPassword(User user, string newPassword, string? newPasswordSha1){- GetAuthenticationProvider(user).ChangeEasyPassword(user, newPassword, newPasswordSha1);+ user.EasyPassword = _cryptoProvider.CreatePasswordHash(newPassword).ToString();UpdateUser(user);OnUserPasswordChanged?.Invoke(this, new GenericEventArgs<User>(user));