Diff

plugins/mod_dialback.lua @ 8509:e1d274001855

Backed out changeset 89c42aff8510: The problem in ejabberd has reportedly been resolved and this change causes more problems than it solves (fixes #1006)
author Kim Alvefur <zash@zash.se>
date Sun, 04 Feb 2018 01:13:27 +0100
parent 8455:1d0862814bfc
child 8514:671343e92070
line wrap: on
line diff
--- a/plugins/mod_dialback.lua	Sat Jan 06 08:54:15 2018 +0100
+++ b/plugins/mod_dialback.lua	Sun Feb 04 01:13:27 2018 +0100
@@ -189,6 +189,14 @@
 	end
 end);
 
+module:hook_stanza("urn:ietf:params:xml:ns:xmpp-sasl", "failure", function (origin, 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_stanza(xmlns_stream, "features", function (origin, stanza)
 	if not origin.external_auth or origin.external_auth == "failed" then
 		module:log("debug", "Initiating dialback...");