From 36c9176b3dbe72714c98fc9e52b0141f0fabcf5a Mon Sep 17 00:00:00 2001
From: Ramon Souza <contato@ramonsouza.com>
Date: Fri, 2 Jul 2021 10:33:17 -0300
Subject: [PATCH] always get token info from current connectionId

---
 bigbluebutton-html5/imports/ui/components/app/container.jsx | 1 +
 bigbluebutton-html5/imports/ui/services/auth/index.js       | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx
index 784de29afd..2670571cb2 100755
--- a/bigbluebutton-html5/imports/ui/components/app/container.jsx
+++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx
@@ -65,6 +65,7 @@ const AppContainer = (props) => {
       navbar={navbar}
       actionsbar={actionsbar}
       media={media}
+      currentUserId={currentUserId}
       {...otherProps}
     />
     : null
diff --git a/bigbluebutton-html5/imports/ui/services/auth/index.js b/bigbluebutton-html5/imports/ui/services/auth/index.js
index ea98f8cb26..3790d29142 100755
--- a/bigbluebutton-html5/imports/ui/services/auth/index.js
+++ b/bigbluebutton-html5/imports/ui/services/auth/index.js
@@ -231,7 +231,11 @@ class Auth {
       Tracker.autorun((c) => {
         computation = c;
 
-        const authenticationTokenValidation = AuthTokenValidation.findOne({}, { sort: { updatedAt: -1 } });
+        const selector = {
+          connectionId: Meteor.connection._lastSessionId,
+        };
+
+        const authenticationTokenValidation = AuthTokenValidation.findOne(selector);
 
         if (!authenticationTokenValidation) return;
 
-- 
GitLab