diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2020-07-04 00:25:00 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-04 00:25:00 -0400 |
| commit | 46f67c9ea4f13e14d5f0b2aa30fdf0e10655c37d (patch) | |
| tree | c98b1461f095ddf1ea6c2143b5b681fc00710d0b /Jellyfin.Server.Implementations/Users/UserManager.cs | |
| parent | 176f25fb98891bfc3b2e3215e957af8cfffd681c (diff) | |
| parent | 44a8ea6bee3cf3fefc3d290dbaaa8c8e1554868f (diff) | |
Merge pull request #3423 from crobibero/easypassword
Remove EasyPassword from Authentication providers
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/UserManager.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Users/UserManager.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index ae5c311bf2..ace9c4af05 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -273,7 +273,17 @@ namespace Jellyfin.Server.Implementations.Users /// <inheritdoc/> public void ChangeEasyPassword(User user, string newPassword, string? newPasswordSha1) { - GetAuthenticationProvider(user).ChangeEasyPassword(user, newPassword, newPasswordSha1); + if (newPassword != null) + { + newPasswordSha1 = _cryptoProvider.CreatePasswordHash(newPassword).ToString(); + } + + if (string.IsNullOrWhiteSpace(newPasswordSha1)) + { + throw new ArgumentNullException(nameof(newPasswordSha1)); + } + + user.EasyPassword = newPasswordSha1; UpdateUser(user); OnUserPasswordChanged?.Invoke(this, new GenericEventArgs<User>(user)); |
