diff --git a/bigbluebutton-html5/imports/api/users/server/publishers.js b/bigbluebutton-html5/imports/api/users/server/publishers.js
index f41ac18982..fbef72e132 100644
--- a/bigbluebutton-html5/imports/api/users/server/publishers.js
+++ b/bigbluebutton-html5/imports/api/users/server/publishers.js
@@ -9,7 +9,7 @@ import { extractCredentials } from '/imports/api/common/server/helpers';
const ROLE_MODERATOR = Meteor.settings.public.user.role_moderator;
-function currentUser() {
+function currentUser(registerCallback) {
if (!this.userId) {
return Users.find({ meetingId: '' });
}
@@ -27,7 +27,9 @@ function currentUser() {
}
});
- this._session.socket.on('close', _.debounce(onCloseConnection, 100));
+ if (registerCallback) {
+ this._session.socket.on('close', _.debounce(onCloseConnection, 100));
+ }
const selector = {
meetingId,
diff --git a/bigbluebutton-html5/imports/ui/services/auth/index.js b/bigbluebutton-html5/imports/ui/services/auth/index.js
index e571a07654..785337a84c 100755
--- a/bigbluebutton-html5/imports/ui/services/auth/index.js
+++ b/bigbluebutton-html5/imports/ui/services/auth/index.js
@@ -229,9 +229,11 @@ class Auth {
return;
}
+ let registerCallback = true;
+
Tracker.autorun((c) => {
computation = c;
- Meteor.subscribe('current-user');
+ Meteor.subscribe('current-user', registerCallback);
const selector = { meetingId: this.meetingID, userId: this.userID };
const fields = {
@@ -242,7 +244,7 @@ class Auth {
if (!User || !('intId' in User)) {
logger.info({ logCode: 'auth_service_resend_validateauthtoken' }, 're-send validateAuthToken for delayed authentication');
makeCall('validateAuthToken', this.meetingID, this.userID, this.token);
-
+ registerCallback = false;
return;
}