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("meetingName", null)
setInSession("bbbServerVersion", "0.90") setInSession("bbbServerVersion", "0.90")
setInSession("userName", null) 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 = -> @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

@ -37,16 +37,17 @@ Template.header.events
"click .signOutIcon": (event) -> "click .signOutIcon": (event) ->
Meteor.call("userLogout", getInSession("meetingId"), getInSession("userId")) Meteor.call("userLogout", getInSession("meetingId"), getInSession("userId"))
setInSession "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 # wipe important session data
Session.keys = {} setInSession("userId", null)
Session.keyDeps = {} setInSession("meetingId", null)
Session.keyDepsDeps = {} setInSession("currentChatId", null)
# # wipe persisted session setInSession("meetingName", null)
SessionAmplify.keys = {} setInSession("bbbServerVersion", null)
SessionAmplify.keyDeps = {} setInSession("userName", null)
SessionAmplify.keyDepsDeps = {} # invalidate user
Meteor.validUser = false # invalidate user setInSession("validUser", false)
Router.go('logout'); # navigate to logout # navigate to logout
Router.go('logout')
"click .hideNavbarIcon": (event) -> "click .hideNavbarIcon": (event) ->
toggleNavbar() toggleNavbar()
"click .settingsIcon": (event) -> "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.configure layoutTemplate: 'layout'
Router.map -> Router.map ->
@ -43,8 +42,8 @@ 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 # Don't let user in if they are not valid if not getInSession("validUser") # Don't let user in if they are not valid
@redirect("logout") @redirect("logout")
@route "logout", @route "logout",
path: "logout" path: "logout"