浏览代码

Fix Api Key authentication

Patrick Barron 4 年之前
父节点
当前提交
fdba71e133
共有 1 个文件被更改,包括 2 次插入9 次删除
  1. 2 9
      Jellyfin.Server.Implementations/Security/AuthorizationContext.cs

+ 2 - 9
Jellyfin.Server.Implementations/Security/AuthorizationContext.cs

@@ -171,15 +171,7 @@ namespace Jellyfin.Server.Implementations.Security
                     updateToken = true;
                 }
 
-                if (!device.UserId.Equals(Guid.Empty))
-                {
-                    authInfo.User = _userManager.GetUserById(device.UserId);
-                    authInfo.IsApiKey = false;
-                }
-                else
-                {
-                    authInfo.IsApiKey = true;
-                }
+                authInfo.User = _userManager.GetUserById(device.UserId);
 
                 if (updateToken)
                 {
@@ -198,6 +190,7 @@ namespace Jellyfin.Server.Implementations.Security
                     authInfo.DeviceId = string.Empty;
                     authInfo.Device = string.Empty;
                     authInfo.Version = string.Empty;
+                    authInfo.IsApiKey = true;
                 }
             }