From 4fc86175e122ca1e12412a5889f7084585280d01 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Fri, 26 Aug 2016 14:41:06 -0500 Subject: [PATCH] mod_auth_token: Set room name on session --- prosody-plugins/mod_auth_token.lua | 10 +++++----- prosody-plugins/token/util.lib.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/prosody-plugins/mod_auth_token.lua b/prosody-plugins/mod_auth_token.lua index 9ff42934d..8a8b6a6ff 100644 --- a/prosody-plugins/mod_auth_token.lua +++ b/prosody-plugins/mod_auth_token.lua @@ -148,15 +148,15 @@ function provider.get_sasl_handler(session) end -- now verify the whole token - local result, msg; + local claims, msg; if asapKeyServer then - result, msg = token_util.verify_token(token, appId, pubKey, disableRoomNameConstraints); + claims, msg = token_util.verify_token(token, appId, pubKey, disableRoomNameConstraints); else - result, msg = token_util.verify_token(token, appId, appSecret, disableRoomNameConstraints); + claims, msg = token_util.verify_token(token, appId, appSecret, disableRoomNameConstraints); end - if result == true then + if claims ~= true then -- Binds room name to the session which is later checked on MUC join - session.jitsi_meet_room = room; + session.jitsi_meet_room = claims["room"]; return true; else return false, "not-allowed", msg diff --git a/prosody-plugins/token/util.lib.lua b/prosody-plugins/token/util.lib.lua index 695f499b1..7ef885a3a 100644 --- a/prosody-plugins/token/util.lib.lua +++ b/prosody-plugins/token/util.lib.lua @@ -30,7 +30,7 @@ local function _verify_token(token, appId, appSecret, disableRoomNameConstraints return nil, "'room' claim is missing"; end - return true; + return claims; end function _M.verify_token(token, appId, appSecret, disableRoomNameConstraints)