Diff

plugins/mod_saslauth.lua @ 3548:cd8d1cacc65b

mod_saslauth: Handle SASL <abort/> properly.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 02 Nov 2010 15:07:25 +0500
parent 3535:b953b0c0f203
child 3551:4fba723ab235
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Tue Nov 02 04:29:54 2010 +0500
+++ b/plugins/mod_saslauth.lua	Tue Nov 02 15:07:25 2010 +0500
@@ -119,8 +119,13 @@
 end
 
 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:auth", sasl_handler);
-module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:abort", sasl_handler);
 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:response", sasl_handler);
+module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:abort", function(event)
+	local session = event.origin;
+	session.sasl_handler = nil;
+	session.send(build_reply("failure", "aborted"));
+	return true;
+end);
 
 local mechanisms_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-sasl' };
 local bind_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-bind' };