bigbluebutton-Github/labs/meteor-client/app/lib/router.coffee

39 lines
1.3 KiB
CoffeeScript
Raw Normal View History

2014-07-28 23:00:07 +08:00
@Router.configure layoutTemplate: 'layout'
2014-07-28 23:00:07 +08:00
@Router.map ->
@route "login",
path: "/login"
action: ->
meetingId = @params.query.meeting_id
userId = @params.query.user_id
authToken = @params.query.auth_token
if meetingId? and userId? and authToken?
Meteor.call("validateAuthToken", meetingId, userId, authToken)
applyNewSessionVars = ->
setInSession("authToken", authToken)
setInSession("meetingId", meetingId)
setInSession("userId", userId)
Router.go('/')
clearSessionVar(applyNewSessionVars)
@route "main",
path: "/"
onBeforeAction: ->
2014-11-22 01:07:16 +08:00
console.log "in main. onBeforeAction"
authToken = getInSession 'authToken'
meetingId = getInSession 'meetingId'
userId = getInSession 'userId'
2014-11-22 01:52:14 +08:00
console.log "currently #{authToken} #{meetingId} #{userId}"
2014-11-22 01:07:16 +08:00
Meteor.subscribe 'chat', meetingId, userId, authToken, ->
Meteor.subscribe 'shapes', meetingId, ->
Meteor.subscribe 'slides', meetingId, ->
Meteor.subscribe 'meetings', meetingId, ->
Meteor.subscribe 'presentations', meetingId, ->
2014-11-22 01:07:16 +08:00
Meteor.subscribe 'users', meetingId, userId, authToken, ->
console.log "done subscribing"
onLoadComplete()
2014-11-22 01:07:16 +08:00
@render('main')