receives validate_auth_token_reply
This commit is contained in:
parent
9d51489c32
commit
c5f5b635b5
@ -48,7 +48,7 @@ public class MeetingMessageHandler implements MessageHandler {
|
||||
bbbGW.destroyMeeting(emm.meetingId);
|
||||
} else if (msg instanceof ValidateAuthTokenMessage) {
|
||||
ValidateAuthTokenMessage emm = (ValidateAuthTokenMessage) msg;
|
||||
log.info("Received ValidateAuthTokenMessage toekn request. Meeting id [{}]", emm.meetingId);
|
||||
log.info("Received ValidateAuthTokenMessage token request. Meeting id [{}]", emm.meetingId);
|
||||
bbbGW.validateAuthToken(emm.meetingId, emm.userId, emm.token, emm.replyTo);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,9 @@ config.redis.post = "6379"
|
||||
config.redis.timeout = 5000
|
||||
config.redis.channels = {}
|
||||
config.redis.channels.fromBBBApps = "bigbluebutton:from-bbb-apps:*"
|
||||
config.redis.channels.toBBBApps = "bigbluebutton:to-bbb-apps:*"
|
||||
config.redis.channels.toBBBApps = {}
|
||||
config.redis.channels.toBBBApps.pattern = "bigbluebutton:to-bbb-apps:*"
|
||||
config.redis.channels.toBBBApps.meeting = "bigbluebutton:to-bbb-apps:meeting"
|
||||
config.redis.internalChannels = {}
|
||||
config.redis.internalChannels.receive = "html5-receive"
|
||||
config.redis.internalChannels.reply = "html5-reply"
|
||||
|
@ -57,10 +57,10 @@ module.exports = class RedisPubSub
|
||||
|
||||
# put the entry in the hash so we can match the response later
|
||||
@pendingRequests[correlationId] = entry
|
||||
message.header.replyTo = correlationId
|
||||
|
||||
log.info({ message: message }, "Publishing a message")
|
||||
@pubClient.publish(config.redis.channels.toBBBApps, JSON.stringify(message))
|
||||
message.header.reply_to = correlationId
|
||||
console.log("\n\n\n\n\nmessage=" + JSON.stringify(message) + "\n\n\n")
|
||||
log.info({ message: message, channel: config.redis.channels.toBBBApps.meeting}, "Publishing a message")
|
||||
@pubClient.publish(config.redis.channels.toBBBApps.meeting, JSON.stringify(message))
|
||||
|
||||
# Send a message without waiting for a reply
|
||||
send: (message, envelope) ->
|
||||
@ -76,7 +76,7 @@ module.exports = class RedisPubSub
|
||||
message = JSON.parse(jsonMsg)
|
||||
|
||||
# retrieve the request entry
|
||||
correlationId = message.header?.replyTo
|
||||
correlationId = message.header?.reply_to
|
||||
if correlationId? and @pendingRequests?[correlationId]?
|
||||
entry = @pendingRequests[correlationId]
|
||||
# make sure the message in the timeout isn't triggered by clearing it
|
||||
|
@ -21,7 +21,7 @@ define [
|
||||
|
||||
connect: ->
|
||||
unless @socket?
|
||||
console.log "\n\n\n\nconnecting to the socket.io server", @host
|
||||
console.log "connecting to the socket.io server", @host
|
||||
@socket = io.connect()
|
||||
@_registerEvents()
|
||||
else
|
||||
@ -52,31 +52,21 @@ define [
|
||||
|
||||
# Immediately say we are connected
|
||||
@socket.on "connect", =>
|
||||
console.log "socket on: connect\n\n\n\n"
|
||||
console.log "socket on: connect"
|
||||
globals.events.trigger("connection:connected")
|
||||
#@socket.emit "user connect" # tell the server we have a new user
|
||||
|
||||
#emit the validate token json message
|
||||
|
||||
getUrlVars = ()->
|
||||
vars = {}
|
||||
parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, (m,key,value) ->
|
||||
vars[key] = value
|
||||
console.log "value=" + value
|
||||
)
|
||||
vars
|
||||
|
||||
|
||||
alert("url=" + window.location.href +
|
||||
"auth_token=" + getUrlVars()["auth_token"] +
|
||||
"user_id=" + getUrlVars()["user_id"] +
|
||||
"meeting_id=" + getUrlVars()["meeting_id"]
|
||||
)
|
||||
|
||||
message = {
|
||||
"payload": {
|
||||
"auth_token": getUrlVars()["auth_token"]
|
||||
"user_id": getUrlVars()["user_id"]
|
||||
"userid": getUrlVars()["user_id"]
|
||||
"meeting_id": getUrlVars()["meeting_id"]
|
||||
},
|
||||
"header": {
|
||||
@ -84,7 +74,11 @@ define [
|
||||
"name": "validate_auth_token"
|
||||
}
|
||||
}
|
||||
@socket.emit "message", message
|
||||
|
||||
validFields = getUrlVars()["auth_token"]? and getUrlVars()["user_id"]? and getUrlVars()["meeting_id"]?
|
||||
|
||||
#emit the validate token json message
|
||||
@socket.emit "message", message if validFields
|
||||
|
||||
# Received event to logout yourself
|
||||
@socket.on "logout", ->
|
||||
|
Loading…
Reference in New Issue
Block a user