Skip to content

Commit

Permalink
refactor(auth_hybrid_matrix_token): minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
emrahcom committed Oct 17, 2024
1 parent 01b3cc1 commit cb66461
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions auth_hybrid_matrix_token/mod_auth_hybrid_matrix_token.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ function init_session(event)
if query ~= nil then
local params = formdecode(query)

if params and params.token then
token = params.token
session.jitsi_room = params.room or nil
if params then
session.jitsi_room = params.room

if params.token then
token = params.token
end
end
end

Expand Down Expand Up @@ -235,7 +238,9 @@ local function matrix_handler(session, payload)
return res, error, reason
end

if payload.context.matrix.room_id == nil then
if not payload.context.matrix.room_id
or payload.context.matrix.room_id == ""
then
module:log("warn", "Missing Matrix room_id in token")
session.auth_token = nil
measure_verify_fail(1)
Expand Down
2 changes: 1 addition & 1 deletion auth_hybrid_matrix_token/mod_matrix_lobby_bypass.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- base32.decode(jitsi_room_name) should match "!.*:.*[.].*" (regex) for related
-- rooms.
--
-- Since the participant is already a valid member of Matrix's room, no need to
-- If the participant is already a valid member of Matrix's room then no need to
-- check her again in Jitsi lobby.
-- -----------------------------------------------------------------------------
local basexx = require 'basexx'
Expand Down

0 comments on commit cb66461

Please sign in to comment.