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" +