From a486cd27a9329265c9ab839ba0416ce674199f96 Mon Sep 17 00:00:00 2001 From: dkanada Date: Mon, 8 Feb 2021 22:54:53 +0900 Subject: [PATCH] Merge pull request #4935 from ConfusedPolarBear/quickconnect-cleanup Remove used quick connect tokens (cherry picked from commit 158e69c6f0efafd5157e39e7c2de80919090cec2) Signed-off-by: Joshua M. Boniface --- Emby.Server.Implementations/Session/SessionManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index 4e026a0e6a..10e28c33a5 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/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); }