Merge pull request #9470 from tdjac0bs/postpone_websocket_close

Postpone websocket close for a failed authToken
This commit is contained in:
Anton Georgiev 2020-05-08 18:17:34 -04:00 committed by GitHub
commit 27623aac36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}`);