Once logged out user cannot return to meeting without the server validating their entrance.

This commit is contained in:
perroned 2014-07-18 06:41:35 -07:00
parent 7e4b88a5d1
commit 730616631a
3 changed files with 17 additions and 1 deletions

View File

@ -55,6 +55,7 @@ Meteor.methods
setInSession("meetingName", null) setInSession("meetingName", null)
setInSession("bbbServerVersion", "0.90") setInSession("bbbServerVersion", "0.90")
setInSession("userName", null) setInSession("userName", null)
Meteor.validUser = true
@getUsersName = -> @getUsersName = ->
name = getInSession("userName") # check if we actually have one in the session name = getInSession("userName") # check if we actually have one in the session

View File

@ -9,6 +9,8 @@ Meteor.startup ->
amplify.store(key, value); amplify.store(key, value);
}, },
});` });`
if getInSession("userId") is "SIGNED_OUT"
Router.go("logout")
SessionAmplify.set "display_usersList", true SessionAmplify.set "display_usersList", true
SessionAmplify.set "display_navbar", true SessionAmplify.set "display_navbar", true
@ -36,7 +38,16 @@ Template.header.events
toggleMic @ toggleMic @
"click .signOutIcon": (event) -> "click .signOutIcon": (event) ->
Meteor.call("userLogout", getInSession("meetingId"), getInSession("userId")) 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'); Router.go('logout');
"click .hideNavbarIcon": (event) -> "click .hideNavbarIcon": (event) ->
toggleNavbar() toggleNavbar()

View File

@ -1,3 +1,4 @@
Meteor.validUser = false
Router.configure layoutTemplate: 'layout' Router.configure layoutTemplate: 'layout'
Router.map -> Router.map ->
@ -42,6 +43,9 @@ Router.map ->
Meteor.subscribe 'shapes', getInSession('meetingId') Meteor.subscribe 'shapes', getInSession('meetingId')
Meteor.subscribe 'slides', getInSession('meetingId') Meteor.subscribe 'slides', getInSession('meetingId')
Meteor.subscribe 'meetings', getInSession('meetingId') Meteor.subscribe 'meetings', getInSession('meetingId')
if Meteor.validUser is false
@redirect("logout")
@route "logout", @route "logout",
path: "logout" path: "logout"