Software / code / prosody
Diff
plugins/mod_dialback.lua @ 8518:0de0018bdf91
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 04 Feb 2018 01:40:11 +0100 |
| parent | 8458:e9c7ac97cb52 |
| parent | 8517:980d2daf3ed4 |
| child | 10376:b337df192a10 |
| child | 11556:6f56170ea986 |
line wrap: on
line diff
--- a/plugins/mod_dialback.lua Sat Feb 03 17:36:55 2018 +0100 +++ b/plugins/mod_dialback.lua Sun Feb 04 01:40:11 2018 +0100 @@ -153,7 +153,7 @@ valid = "invalid"; end if dialback_verifying.destroyed then - log("warn", "Incoming s2s session %s was closed in the meantime, so we can't notify it of the db result", + log("warn", "Incoming s2s session %s was closed in the meantime, so we can't notify it of the dialback result", tostring(dialback_verifying):match("%w+$")); else dialback_verifying.sends2s( @@ -190,6 +190,14 @@ end end); +module:hook_tag("urn:ietf:params:xml:ns:xmpp-sasl", "failure", function (origin, stanza) -- luacheck: ignore 212/stanza + if origin.external_auth == "failed" then + module:log("debug", "SASL EXTERNAL failed, falling back to dialback"); + initiate_dialback(origin); + return true; + end +end, 100); + module:hook_tag(xmlns_stream, "features", function (origin, stanza) -- luacheck: ignore 212/stanza if not origin.external_auth or origin.external_auth == "failed" then module:log("debug", "Initiating dialback...");