aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2023-11-30 11:22:40 +0000
committerMatthew Wild <mwild1@gmail.com>2023-11-30 11:22:40 +0000
commit82e46a35f56f366f3def079c250a35bf57b44c9f (patch)
tree0b38c6a327950a51f0dc2ff642bf2312a7a2d9cc /plugins
parent42635373017bab50a000919617cc6510e0b5604a (diff)
downloadprosody-82e46a35f56f366f3def079c250a35bf57b44c9f.tar.gz
prosody-82e46a35f56f366f3def079c250a35bf57b44c9f.zip
mod_saslauth: Allow plugins to override return SASL condition/text
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_saslauth.lua4
1 files changed, 3 insertions, 1 deletions
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