diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-02 23:03:02 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-02 23:03:02 +0100 |
commit | 8b9646fee679b47520503b7eaafff9539a3ea3f2 (patch) | |
tree | 4b71bdc7622635a101579c04b2d9e0c56991df2c /plugins/mod_saslauth.lua | |
parent | 55ba289bedc1580f49af034b8a849958b698de77 (diff) | |
parent | c0937dcdb42f9ac2fc928aa91f1474607b735590 (diff) | |
download | prosody-8b9646fee679b47520503b7eaafff9539a3ea3f2.tar.gz prosody-8b9646fee679b47520503b7eaafff9539a3ea3f2.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r-- | plugins/mod_saslauth.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 68c4fe64..ee468c17 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -96,8 +96,19 @@ end) module:hook_stanza(xmlns_sasl, "failure", function (session, stanza) if session.type ~= "s2sout_unauthed" or session.external_auth ~= "attempting" then return; end - module:log("info", "SASL EXTERNAL with %s failed", session.to_host) - -- TODO: Log the failure reason + local text = stanza:get_child_text("text"); + local condition = "unknown-condition"; + for child in stanza:childtags() do + if child.name ~= "text" then + condition = child.name; + break; + end + end + if text and condition then + condition = connection .. ": " .. text; + end + module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition); + session.external_auth = "failed" session:close(); return true; |