mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-23 15:30:56 -04:00
implement ChangeEasyPassword from legacy provider
This commit is contained in:
parent
3169b0af89
commit
44a8ea6bee
@ -263,7 +263,17 @@ namespace Jellyfin.Server.Implementations.Users
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void ChangeEasyPassword(User user, string newPassword, string? newPasswordSha1)
|
public void ChangeEasyPassword(User user, string newPassword, string? newPasswordSha1)
|
||||||
{
|
{
|
||||||
user.EasyPassword = _cryptoProvider.CreatePasswordHash(newPassword).ToString();
|
if (newPassword != null)
|
||||||
|
{
|
||||||
|
newPasswordSha1 = _cryptoProvider.CreatePasswordHash(newPassword).ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(newPasswordSha1))
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(newPasswordSha1));
|
||||||
|
}
|
||||||
|
|
||||||
|
user.EasyPassword = newPasswordSha1;
|
||||||
UpdateUser(user);
|
UpdateUser(user);
|
||||||
|
|
||||||
OnUserPasswordChanged?.Invoke(this, new GenericEventArgs<User>(user));
|
OnUserPasswordChanged?.Invoke(this, new GenericEventArgs<User>(user));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user