2014-06-19 04:11:29 +08:00
|
|
|
Router.configure layoutTemplate: 'layout'
|
|
|
|
|
|
|
|
Router.map ->
|
|
|
|
@route "login",
|
|
|
|
path: "/meeting_id=*"
|
|
|
|
action: () ->
|
|
|
|
@redirect('/')
|
2014-06-20 02:13:12 +08:00
|
|
|
Meteor.subscribe 'users', Session.get('meetingId')
|
|
|
|
|
2014-06-19 05:20:32 +08:00
|
|
|
onBeforeAction: ()->
|
2014-06-19 04:11:29 +08:00
|
|
|
url = location.href
|
|
|
|
console.log "\n\nurl=#{url}\n\n"
|
2014-06-19 05:20:32 +08:00
|
|
|
#extract the meeting_id, user_id, auth_token, etc from the uri
|
2014-06-19 04:11:29 +08:00
|
|
|
if url.indexOf("meeting_id") > -1 # if the URL is /meeting_id=...&...
|
|
|
|
urlParts = url.split("&");
|
|
|
|
|
|
|
|
meetingId = urlParts[0]?.split("=")[1];
|
|
|
|
console.log "meetingId=" + meetingId
|
|
|
|
|
|
|
|
userId = urlParts[1]?.split("=")[1];
|
|
|
|
console.log "userId=" + userId
|
|
|
|
|
|
|
|
authToken = urlParts[2]?.split("=")[1];
|
|
|
|
console.log "authToken=" + authToken
|
|
|
|
|
|
|
|
userName = urlParts[3]?.split("=")[1];
|
|
|
|
console.log "userName=" + userName
|
|
|
|
if meetingId? and userId? and authToken? and userName?
|
2014-06-27 02:09:39 +08:00
|
|
|
#Meteor.call("runRedisAndValidate", meetingId, userId, authToken)
|
|
|
|
#Meteor.call('sendMeetingInfoToClient', meetingId, userId)
|
2014-06-19 04:11:29 +08:00
|
|
|
else
|
|
|
|
console.log "unable to extract from the URL some of {meetingId, userName, userId, authToken}"
|
2014-06-19 01:31:42 +08:00
|
|
|
else
|
2014-06-19 04:11:29 +08:00
|
|
|
console.log "unable to extract the required information for the meeting from the URL"
|
|
|
|
@route "main",
|
|
|
|
path: "/"
|