aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-02-04 01:01:50 +0100
committerKim Alvefur <zash@zash.se>2018-02-04 01:01:50 +0100
commite00503705b568cd532f38373fde34757bc580296 (patch)
treec1e8af511e9304c5ff7969bc903602cfe7c0294d
parent0e96df74102467122e107756073053abd96b9670 (diff)
downloadprosody-e00503705b568cd532f38373fde34757bc580296.tar.gz
prosody-e00503705b568cd532f38373fde34757bc580296.zip
mod_saslauth: Pass SASL EXTERNAL failure reason on to be used in error bounces
-rw-r--r--plugins/mod_saslauth.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 3ca709e0..3eda2a24 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -110,11 +110,12 @@ module:hook_tag(xmlns_sasl, "failure", function (session, stanza)
module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition);
session.external_auth = "failed"
+ session.external_auth_failure_reason = condition;
end, 500)
module:hook_stanza(xmlns_sasl, "failure", function (session, stanza)
session.log("debug", "No fallback from SASL EXTERNAL failure, giving up");
- session:close();
+ session:close(nil, session.external_auth_failure_reason);
return true;
end, 90)