瀏覽代碼

Merge pull request #6822 from NickSica/master

Cody Robibero 3 年之前
父節點
當前提交
8868b34d78
共有 1 個文件被更改,包括 15 次插入3 次删除
  1. 15 3
      Jellyfin.Server.Implementations/Security/AuthorizationContext.cs

+ 15 - 3
Jellyfin.Server.Implementations/Security/AuthorizationContext.cs

@@ -185,9 +185,21 @@ namespace Jellyfin.Server.Implementations.Security
                     authInfo.IsAuthenticated = true;
                     authInfo.Client = key.Name;
                     authInfo.Token = key.AccessToken;
-                    authInfo.DeviceId = string.Empty;
-                    authInfo.Device = string.Empty;
-                    authInfo.Version = string.Empty;
+                    if (string.IsNullOrWhiteSpace(authInfo.DeviceId))
+                    {
+                        authInfo.DeviceId = string.Empty;
+                    }
+
+                    if (string.IsNullOrWhiteSpace(authInfo.Device))
+                    {
+                        authInfo.Device = string.Empty;
+                    }
+
+                    if (string.IsNullOrWhiteSpace(authInfo.Version))
+                    {
+                        authInfo.Version = string.Empty;
+                    }
+
                     authInfo.IsApiKey = true;
                 }
             }