feat(jwt): Adds more logs when jwt is expired.

This commit is contained in:
damencho
2024-06-07 08:33:12 -05:00
committed by Дамян Минков
parent befffa7e85
commit efd2db70ca
3 changed files with 5 additions and 4 deletions

View File

@@ -226,7 +226,7 @@ function M.verify(token, expectedAlgo, key, acceptedIssuers, acceptedAudiences)
if body.exp and os.time() >= body.exp then
return nil, "Not acceptable by exp"
return nil, "Not acceptable by exp ("..tostring(os.time()-body.exp)..")"
end
if body.nbf and os.time() < body.nbf then

View File

@@ -101,7 +101,8 @@ function provider.get_sasl_handler(session)
local res, error, reason = token_util:process_and_verify_token(session);
if res == false then
module:log("warn",
"Error verifying token err:%s, reason:%s", error, reason);
"Error verifying token err:%s, reason:%s tenant:%s room:%s",
error, reason, session.jitsi_web_query_prefix, session.jitsi_web_query_room);
session.auth_token = nil;
measure_verify_fail(1);
return res, error, reason;

View File

@@ -26,5 +26,5 @@ function init_session(event)
end
end
module:hook_global("bosh-session", init_session);
module:hook_global("websocket-session", init_session);
module:hook_global("bosh-session", init_session, 1);
module:hook_global("websocket-session", init_session, 1);