diff options
Diffstat (limited to 'Jellyfin.Server.Implementations/Users')
4 files changed, 12 insertions, 6 deletions
diff --git a/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs index cb2d09a67..acada7aa4 100644 --- a/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs +++ b/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs @@ -1,9 +1,11 @@ using System; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.Threading.Tasks; using Jellyfin.Data.Entities; using MediaBrowser.Controller.Authentication; using MediaBrowser.Model.Cryptography; +using Microsoft.Extensions.Logging; namespace Jellyfin.Server.Implementations.Users { @@ -12,14 +14,17 @@ namespace Jellyfin.Server.Implementations.Users /// </summary> public class DefaultAuthenticationProvider : IAuthenticationProvider, IRequiresResolvedUser { + private readonly ILogger<DefaultAuthenticationProvider> _logger; private readonly ICryptoProvider _cryptographyProvider; /// <summary> /// Initializes a new instance of the <see cref="DefaultAuthenticationProvider"/> class. /// </summary> + /// <param name="logger">The logger.</param> /// <param name="cryptographyProvider">The cryptography provider.</param> - public DefaultAuthenticationProvider(ICryptoProvider cryptographyProvider) + public DefaultAuthenticationProvider(ILogger<DefaultAuthenticationProvider> logger, ICryptoProvider cryptographyProvider) { + _logger = logger; _cryptographyProvider = cryptographyProvider; } @@ -75,8 +80,10 @@ namespace Jellyfin.Server.Implementations.Users } // Migrate old hashes to the new default - if (!string.Equals(readyHash.Id, _cryptographyProvider.DefaultHashMethod, StringComparison.Ordinal)) + if (!string.Equals(readyHash.Id, _cryptographyProvider.DefaultHashMethod, StringComparison.Ordinal) + || int.Parse(readyHash.Parameters["iterations"], CultureInfo.InvariantCulture) != Constants.DefaultIterations) { + _logger.LogInformation("Migrating password hash of {User} to the latest default", username); ChangePassword(resolvedUser, password); } diff --git a/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs b/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs index 634aea9f0..45b0a0853 100644 --- a/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs +++ b/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs @@ -1,4 +1,4 @@ -using System.Threading; +using System.Threading; using System.Threading.Tasks; using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; diff --git a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs index edc6aa173..e204a16a6 100644 --- a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs +++ b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs @@ -1,4 +1,4 @@ -#pragma warning disable CA1307 +#pragma warning disable CA1307 #pragma warning disable CA1309 using System; diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index 5753e75c9..eb4bc2aff 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -1,4 +1,4 @@ -#pragma warning disable CA1307 +#pragma warning disable CA1307 using System; using System.Collections.Concurrent; @@ -384,7 +384,6 @@ namespace Jellyfin.Server.Implementations.Users public async Task<User?> AuthenticateUser( string username, string password, - string passwordSha1, string remoteEndPoint, bool isUserSession) { |
