How get access to content of JWT token in custom module?

Hello.
I use JWT token auth and I try write simple module, which use content from field of JWT token.

local st = require "util.stanza";
local jid = require "util.jid";
local nodeprep = require "util.encodings".stringprep.nodeprep;
module:hook("muc-room-created", function(event)
    local origin, stanza = event.origin, event.stanza;
    module:log("info", "token: %s, room: %s", tostring(origin.auth_token), tostring(origin.jitsi_meet_room))
end, 10);

I connect to room with token, in prosody logs I see token is nil:

prosody_1  | muc.meet.jitsi:pre_create_room_handler   info	token: nil, room: nil

How I can get token ?

This one gets the token from the session and checks some stuff there https://github.com/jitsi/jitsi-meet/blob/master/resources/prosody-plugins/mod_filter_iq_rayo.lua#L29

Thank you for answer, but I copypaste code:

    local session = event.origin;
    local token = session.auth_token;
    module:log("info", "TEST session token %s)", tostring(token))

And this code give me nil:

prosody_1  | muc.meet.jitsi:pre_create_room_handler    info	TEST session token nil)

hi @Evg I have same problem with you. Did you solve your issue ?

Yes.
This module help me: https://github.com/nvonahsen/jitsi-token-moderation-plugin/blob/master/mod_token_moderation.lua

I use it too. But doesn’t work. I try enable confing

enableUserRolesBasedOnToken: true,
enableFeaturesBasedOnToken: true,
lockRoomGuestEnabled: true,

I try to past token with https://mydomain.com/hello?jwt=token . All user join with token will be as a moderator? Is that true?

Yes.

I try join with jwt but I didn’t become moderator. Did I miss some config for this? @damencho