diff --git a/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js b/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js index dae1bf3b4a757d0e73d93f7f6c44096cafa00f97..5831b5e1304f710c795356fde3c70c45b30f2121 100644 --- a/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js +++ b/bigbluebutton-html5/imports/api/users/server/handlers/validateAuthToken.js @@ -31,7 +31,11 @@ export default function handleValidateAuthToken({ body }, meetingId) { const {methodInvocationObject} = pendingAuth; const connectionId = methodInvocationObject.connection.id; - methodInvocationObject.connection.close(); + // Schedule socket disconnection for this user, giving some time for client receiving the reason of disconnection + setTimeout(()=>{ + methodInvocationObject.connection.close(); + }, 2000); + Logger.info(`Closed connection ${connectionId} due to invalid auth token.`); } catch (e) { Logger.error(`Error closing socket for meetingId '${meetingId}', userId '${userId}', authToken ${authToken}`);