浏览代码

fixed nul user check to be first per justaman

Phallacy 6 年之前
父节点
当前提交
1ffd443d5a
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs

+ 5 - 4
Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs

@@ -32,15 +32,16 @@ namespace Emby.Server.Implementations.Library
 
         //This is the verson that we need to use for local users. Because reasons.
         public Task<ProviderAuthenticationResult> Authenticate(string username, string password, User resolvedUser)
-        {
-            ConvertPasswordFormat(resolvedUser);
-            byte[] passwordbytes = Encoding.UTF8.GetBytes(password);
-            bool success = false;
+        {
+            bool success = false;
             if (resolvedUser == null)
             {
                 success = false;
                 throw new Exception("Invalid username or password");
             }
+            ConvertPasswordFormat(resolvedUser);
+            byte[] passwordbytes = Encoding.UTF8.GetBytes(password);
+           
             if (!resolvedUser.Password.Contains("$"))
             {
                 ConvertPasswordFormat(resolvedUser);