Fixed logout issue

This commit is contained in:
perroned 2014-07-18 08:18:27 -07:00
parent 2461be4edf
commit 1113ecc114
3 changed files with 14 additions and 14 deletions

View File

@ -55,7 +55,7 @@ Meteor.methods
setInSession("meetingName", null)
setInSession("bbbServerVersion", "0.90")
setInSession("userName", null)
Meteor.validUser = true # got info from server, user is a valid user
setInSession("validUser", true) # got info from server, user is a valid user
@getUsersName = ->
name = getInSession("userName") # check if we actually have one in the session

View File

@ -37,16 +37,17 @@ Template.header.events
"click .signOutIcon": (event) ->
Meteor.call("userLogout", getInSession("meetingId"), getInSession("userId"))
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 # invalidate user
Router.go('logout'); # navigate to logout
# wipe important session data
setInSession("userId", null)
setInSession("meetingId", null)
setInSession("currentChatId", null)
setInSession("meetingName", null)
setInSession("bbbServerVersion", null)
setInSession("userName", null)
# invalidate user
setInSession("validUser", false)
# navigate to logout
Router.go('logout')
"click .hideNavbarIcon": (event) ->
toggleNavbar()
"click .settingsIcon": (event) ->

View File

@ -1,4 +1,3 @@
Meteor.validUser = false # shared non-session variable to determine anywhere whether user is valid
Router.configure layoutTemplate: 'layout'
Router.map ->
@ -43,8 +42,8 @@ Router.map ->
Meteor.subscribe 'shapes', getInSession('meetingId')
Meteor.subscribe 'slides', getInSession('meetingId')
Meteor.subscribe 'meetings', getInSession('meetingId')
if Meteor.validUser is false # Don't let user in if they are not valid
@redirect("logout")
if not getInSession("validUser") # Don't let user in if they are not valid
@redirect("logout")
@route "logout",
path: "logout"