Przeglądaj źródła

mod_auth_token: Set room name on session

master
Sam Whited 8 lat temu
rodzic
commit
4fc86175e1

+ 5
- 5
prosody-plugins/mod_auth_token.lua Wyświetl plik

@@ -148,15 +148,15 @@ function provider.get_sasl_handler(session)
148 148
 		end
149 149
 
150 150
 		-- now verify the whole token
151
-		local result, msg;
151
+		local claims, msg;
152 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 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 156
 		end
157
-		if result == true then
157
+		if claims ~= true then
158 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 160
 			return true;
161 161
 		else
162 162
 			return false, "not-allowed", msg

+ 1
- 1
prosody-plugins/token/util.lib.lua Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz