From 42756c02be58eeaae3cf55c99b1b1d8604a57ba9 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 2 Nov 2010 15:07:25 +0500 Subject: mod_saslauth: Handle SASL properly. --- plugins/mod_saslauth.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 94dc8808..85f7fcbf 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -119,8 +119,13 @@ local function sasl_handler(event) 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' }; -- cgit v1.2.3