瀏覽代碼

Remove quick connect tokens after usage

Matt Montgomery 4 年之前
父節點
當前提交
8dd83327b5
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Emby.Server.Implementations/Session/SessionManager.cs

+ 6 - 1
Emby.Server.Implementations/Session/SessionManager.cs

@@ -1456,7 +1456,12 @@ namespace Emby.Server.Implementations.Session
                 throw new SecurityException("Unknown quick connect token");
             }
 
-            request.UserId = result.Items[0].UserId;
+            var info = result.Items[0];
+            request.UserId = info.UserId;
+
+            // There's no need to keep the quick connect token in the database, as AuthenticateNewSessionInternal() issues a long lived token.
+            _authRepo.Delete(info);
+
             return AuthenticateNewSessionInternal(request, false);
         }