comparison mod_log_sasl_mech/mod_log_sasl_mech.lua @ 5772:5ff8022466ab

mod_log_sasl_mech: Handle auth event from other than mod_saslauth E.g. mod_http_oauth2
author Kim Alvefur <zash@zash.se>
date Mon, 04 Dec 2023 21:38:27 +0100
parents 4baaa5a66a5a
children
comparison
equal deleted inserted replaced
5771:72799c330986 5772:5ff8022466ab
1 1
2 module:hook("authentication-success", function (event) 2 module:hook("authentication-success", function (event)
3 local session = event.session; 3 local session = event.session;
4 local sasl_handler = session.sasl_handler; 4 local sasl_handler = session and session.sasl_handler;
5 session.log("info", "Authenticated with %s", sasl_handler and sasl_handler.selected or "legacy auth"); 5 local log = session and session.log or module._log
6 log("info", "Authenticated with %s", sasl_handler and sasl_handler.selected or "legacy auth");
6 end); 7 end);