From 82e46a35f56f366f3def079c250a35bf57b44c9f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 30 Nov 2023 11:22:40 +0000 Subject: mod_saslauth: Allow plugins to override return SASL condition/text --- plugins/mod_saslauth.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index f4ee1f7f..8b85ca41 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -56,8 +56,10 @@ local function handle_status(session, status, ret, err_msg) return "failure", "temporary-auth-failure", "Connection gone"; end if status == "failure" then - module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg }); + local event = { session = session, condition = ret, text = err_msg }; + module:fire_event("authentication-failure", event); session.sasl_handler = session.sasl_handler:clean_clone(); + ret, err_msg = event.condition, event.text; elseif status == "success" then local ok, err = sm_make_authenticated(session, session.sasl_handler.username, session.sasl_handler.role); if ok then -- cgit v1.2.3