aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-07 22:55:51 +0100
committerKim Alvefur <zash@zash.se>2019-12-07 22:55:51 +0100
commit9589da30b6968a355552a1e8be4b7baeaa905c4a (patch)
treeab77168f5e0ac773b8d42ca7c4a3b7f3c84c49d6 /plugins
parent0de6ce740e87fd4f8a8c797cdbbefbd626b3f4e5 (diff)
downloadprosody-9589da30b6968a355552a1e8be4b7baeaa905c4a.tar.gz
prosody-9589da30b6968a355552a1e8be4b7baeaa905c4a.zip
mod_saslauth: Set a nicer bounce error explaining SASL EXTERNAL failures
Better than the previous string concatenation of SASL failure condition and optional text sent by the remote server. Would be nice to have a text per condition, other than the probably most common 'not-authorized'.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_saslauth.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index b5604883..ecce8361 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -120,7 +120,10 @@ end, 500)
module:hook_tag(xmlns_sasl, "failure", function (session, stanza) -- luacheck: ignore 212/stanza
session.log("debug", "No fallback from SASL EXTERNAL failure, giving up");
- session:close(nil, session.external_auth_failure_reason);
+ session:close(nil, session.external_auth_failure_reason, errors.new({
+ type = "wait", condition = "remote-server-timeout",
+ text = "Could not authenticate to remote server",
+ }, { session = session, sasl_failure = session.external_auth_failure_reason, }));
return true;
end, 90)