瀏覽代碼

mod_auth_token: Set room name on session

master
Sam Whited 8 年之前
父節點
當前提交
4fc86175e1
共有 2 個檔案被更改,包括 6 行新增6 行删除
  1. 5
    5
      prosody-plugins/mod_auth_token.lua
  2. 1
    1
      prosody-plugins/token/util.lib.lua

+ 5
- 5
prosody-plugins/mod_auth_token.lua 查看文件

148
 		end
148
 		end
149
 
149
 
150
 		-- now verify the whole token
150
 		-- now verify the whole token
151
-		local result, msg;
151
+		local claims, msg;
152
 		if asapKeyServer then
152
 		if asapKeyServer then
153
-			result, msg = token_util.verify_token(token, appId, pubKey, disableRoomNameConstraints);
153
+			claims, msg = token_util.verify_token(token, appId, pubKey, disableRoomNameConstraints);
154
 		else
154
 		else
155
-			result, msg = token_util.verify_token(token, appId, appSecret, disableRoomNameConstraints);
155
+			claims, msg = token_util.verify_token(token, appId, appSecret, disableRoomNameConstraints);
156
 		end
156
 		end
157
-		if result == true then
157
+		if claims ~= true then
158
 			-- Binds room name to the session which is later checked on MUC join
158
 			-- Binds room name to the session which is later checked on MUC join
159
-			session.jitsi_meet_room = room;
159
+			session.jitsi_meet_room = claims["room"];
160
 			return true;
160
 			return true;
161
 		else
161
 		else
162
 			return false, "not-allowed", msg
162
 			return false, "not-allowed", msg

+ 1
- 1
prosody-plugins/token/util.lib.lua 查看文件

30
 		return nil, "'room' claim is missing";
30
 		return nil, "'room' claim is missing";
31
 	end
31
 	end
32
 
32
 
33
-	return true;
33
+	return claims;
34
 end
34
 end
35
 
35
 
36
 function _M.verify_token(token, appId, appSecret, disableRoomNameConstraints)
36
 function _M.verify_token(token, appId, appSecret, disableRoomNameConstraints)

Loading…
取消
儲存