The Free Software Media System - Server Backend & API
Fix login
Bond_009efc4805233fe
diff --git a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.csindex b07244fda1..2282b8efb6 100644--- a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs+++ b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs@@ -37,7 +37,7 @@ namespace Emby.Server.Implementations.Librarythrow new ArgumentNullException(nameof(resolvedUser));}- // As long as jellyfin supports passwordless users, we need this little block here to accomodate+ // As long as jellyfin supports passwordless users, we need this little block here to accommodateif (!HasPassword(resolvedUser) && string.IsNullOrEmpty(password)){return Task.FromResult(new ProviderAuthenticationResult@@ -105,6 +105,7 @@ namespace Emby.Server.Implementations.Librarypublic Task ChangePassword(User user, string newPassword){ConvertPasswordFormat(user);+// This is needed to support changing a no password user to a password userif (string.IsNullOrEmpty(user.Password)){diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.csindex f08d070ca6..0192805b85 100644--- a/MediaBrowser.Api/UserService.cs+++ b/MediaBrowser.Api/UserService.cs@@ -418,7 +418,7 @@ namespace MediaBrowser.Apireturn ToOptimizedResult(result);}- catch(SecurityException e)+ catch (SecurityException e){// rethrow adding IP address to messagethrow new SecurityException($"[{Request.RemoteIp}] {e.Message}");diff --git a/MediaBrowser.Model/Cryptography/PasswordHash.cs b/MediaBrowser.Model/Cryptography/PasswordHash.csindex 4bcf0c117f..6e66f20883 100644--- a/MediaBrowser.Model/Cryptography/PasswordHash.cs+++ b/MediaBrowser.Model/Cryptography/PasswordHash.cs@@ -69,6 +69,13 @@ namespace MediaBrowser.Model.Cryptography}}+ public PasswordHash(ICryptoProvider cryptoProvider)+ {+ _id = cryptoProvider.DefaultHashMethod;+ _salt = cryptoProvider.GenerateSalt();+ _hash = Array.Empty<Byte>();+ }+public string Id { get => _id; set => _id = value; }public Dictionary<string, string> Parameters { get => _parameters; set => _parameters = value; }@@ -77,13 +84,6 @@ namespace MediaBrowser.Model.Cryptographypublic byte[] Hash { get => _hash; set => _hash = value; }- public PasswordHash(ICryptoProvider cryptoProvider)- {- _id = cryptoProvider.DefaultHashMethod;- _salt = cryptoProvider.GenerateSalt();- _hash = Array.Empty<Byte>();- }-// TODO: move this class and use the HexHelper classpublic static byte[] ConvertFromByteString(string byteString){@@ -127,7 +127,7 @@ namespace MediaBrowser.Model.Cryptographystr.Append(_id);SerializeParameters(str);- if (_salt.Length == 0)+ if (_salt.Length != 0){str.Append('$');str.Append(ConvertToByteString(_salt));