From 730616631aabb32a0ab5327b54bbd8552ec5e526 Mon Sep 17 00:00:00 2001 From: perroned Date: Fri, 18 Jul 2014 06:41:35 -0700 Subject: [PATCH] Once logged out user cannot return to meeting without the server validating their entrance. --- labs/meteor-client/client/globals.coffee | 1 + labs/meteor-client/client/main.coffee | 13 ++++++++++++- labs/meteor-client/lib/router.coffee | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/labs/meteor-client/client/globals.coffee b/labs/meteor-client/client/globals.coffee index 0e2d07cb75..0cde61ea4e 100755 --- a/labs/meteor-client/client/globals.coffee +++ b/labs/meteor-client/client/globals.coffee @@ -55,6 +55,7 @@ Meteor.methods setInSession("meetingName", null) setInSession("bbbServerVersion", "0.90") setInSession("userName", null) + Meteor.validUser = true @getUsersName = -> name = getInSession("userName") # check if we actually have one in the session diff --git a/labs/meteor-client/client/main.coffee b/labs/meteor-client/client/main.coffee index 4d2053fc60..1fe61de481 100755 --- a/labs/meteor-client/client/main.coffee +++ b/labs/meteor-client/client/main.coffee @@ -9,6 +9,8 @@ Meteor.startup -> amplify.store(key, value); }, });` + if getInSession("userId") is "SIGNED_OUT" + Router.go("logout") SessionAmplify.set "display_usersList", true SessionAmplify.set "display_navbar", true @@ -36,7 +38,16 @@ Template.header.events toggleMic @ "click .signOutIcon": (event) -> Meteor.call("userLogout", getInSession("meetingId"), getInSession("userId")) - Session.set "display_navbar", false # needed to hide navbar when the layout template renders + setInSession "display_navbar", false # needed to hide navbar when the layout template renders + # wipe session + Session.keys = {} + Session.keyDeps = {} + Session.keyDepsDeps = {} + # # wipe persisted session + SessionAmplify.keys = {} + SessionAmplify.keyDeps = {} + SessionAmplify.keyDepsDeps = {} + Meteor.validUser = false Router.go('logout'); "click .hideNavbarIcon": (event) -> toggleNavbar() diff --git a/labs/meteor-client/lib/router.coffee b/labs/meteor-client/lib/router.coffee index fb41759a43..d96ca209f0 100755 --- a/labs/meteor-client/lib/router.coffee +++ b/labs/meteor-client/lib/router.coffee @@ -1,3 +1,4 @@ +Meteor.validUser = false Router.configure layoutTemplate: 'layout' Router.map -> @@ -42,6 +43,9 @@ Router.map -> Meteor.subscribe 'shapes', getInSession('meetingId') Meteor.subscribe 'slides', getInSession('meetingId') Meteor.subscribe 'meetings', getInSession('meetingId') + if Meteor.validUser is false + @redirect("logout") @route "logout", path: "logout" +