From 43f3a041f86b73c63ebea61a1200b7d27eebea3a Mon Sep 17 00:00:00 2001 From: perroned Date: Fri, 8 Aug 2014 06:09:39 -0700 Subject: [PATCH] Outlined changes that need to be made to prevent users from having multiple sessions. --- labs/meteor-client/lib/router.coffee | 10 +++++++++- labs/meteor-client/server/redispubsub.coffee | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/labs/meteor-client/lib/router.coffee b/labs/meteor-client/lib/router.coffee index baedce7484..5e85e7f630 100755 --- a/labs/meteor-client/lib/router.coffee +++ b/labs/meteor-client/lib/router.coffee @@ -33,7 +33,15 @@ console.log "authToken=" + authToken if meetingId? and userId? and authToken? - Meteor.call("validate", meetingId, userId, authToken) + # Here we need to check whether there is already a user using userId inside meetingId, if there is don't let this user log in, it is a duplicate + ### + if Meteor.call("validateUserId", meetingId, userId) + continue + else + kick user out + ### + + Meteor.call("validateAuthToken", meetingId, userId, authToken) Meteor.call('sendMeetingInfoToClient', meetingId, userId) else console.log "unable to extract from the URL some of {meetingId, userId, authToken}" diff --git a/labs/meteor-client/server/redispubsub.coffee b/labs/meteor-client/server/redispubsub.coffee index cd21f75f8e..14b4e92d0b 100755 --- a/labs/meteor-client/server/redispubsub.coffee +++ b/labs/meteor-client/server/redispubsub.coffee @@ -1,5 +1,5 @@ Meteor.methods - validate: (meetingId, userId, authToken) -> + validateAuthToken: (meetingId, userId, authToken) -> Meteor.redisPubSub.sendValidateToken(meetingId, userId, authToken) userLogout: (meetingId, userId) ->