Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Allow both regex and normal check for the room name

Andrei Bora27481f027052
diff --git a/resources/prosody-plugins/token/util.lib.lua b/resources/prosody-plugins/token/util.lib.lua
index c881eae9f9..81d8aa7b27 100644
--- a/resources/prosody-plugins/token/util.lib.lua
+++ b/resources/prosody-plugins/token/util.lib.lua
@@ -304,6 +304,9 @@ function Util:process_and_verify_token(session, acceptedIssuers)
-- Binds any features details to the session
session.jitsi_meet_context_features = claims["context"]["features"];
end
+ if claims["context"]["room"] ~= nil then
+ session.jitsi_meet_context_room = claims["context"]["room"]
+ end
end
return true;
else
@@ -370,12 +373,17 @@ function Util:verify_room(session, room_address)
room_to_check = room_node;
end
else
- -- no wildcard, so check room against authorized room regex from the token
- if target_room ~= nil then
- -- room with subdomain
- room_to_check = target_room:match(auth_room);
+ -- no wildcard, so check room against authorized room from the token
+ if session.jitsi_meet_context_room and (session.jitsi_meet_context_room["regex"] == true or session.jitsi_meet_context_room["regex"] == "true") then
+ if target_room ~= nil then
+ -- room with subdomain
+ room_to_check = target_room:match(auth_room);
+ else
+ room_to_check = room_node:match(auth_room);
+ end
else
- room_to_check = room_node:match(auth_room);
+ -- not a regex
+ room_to_check = auth_room;
end
module:log("debug", "room to check: %s", room_to_check)
if not room_to_check then