# HG changeset patch # User Kim Alvefur # Date 1701722307 -3600 # Node ID 5ff8022466ab1418abaab09a9eb9d57fb90cc04d # Parent 72799c330986d2ffc2659fc4feabb0429f26524d mod_log_sasl_mech: Handle auth event from other than mod_saslauth E.g. mod_http_oauth2 diff -r 72799c330986 -r 5ff8022466ab mod_log_sasl_mech/mod_log_sasl_mech.lua --- a/mod_log_sasl_mech/mod_log_sasl_mech.lua Mon Dec 04 21:36:35 2023 +0100 +++ b/mod_log_sasl_mech/mod_log_sasl_mech.lua Mon Dec 04 21:38:27 2023 +0100 @@ -1,6 +1,7 @@ module:hook("authentication-success", function (event) local session = event.session; - local sasl_handler = session.sasl_handler; - session.log("info", "Authenticated with %s", sasl_handler and sasl_handler.selected or "legacy auth"); + local sasl_handler = session and session.sasl_handler; + local log = session and session.log or module._log + log("info", "Authenticated with %s", sasl_handler and sasl_handler.selected or "legacy auth"); end);