X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_legacyauth.lua;h=5fb664415682661f6fb30fac87152e72b703b3fc;hb=99b003b1917a8ab0b561f7fb98d28d1fad8f8dc8;hp=7a3038bc83bb60dc23993695f030efec8779ae16;hpb=ccbc4c6ef0c1280d36beec8dc1b3f99b69e5c964;p=prosody.git diff --git a/plugins/mod_legacyauth.lua b/plugins/mod_legacyauth.lua index 7a3038bc..5fb66441 100644 --- a/plugins/mod_legacyauth.lua +++ b/plugins/mod_legacyauth.lua @@ -35,7 +35,7 @@ module:hook("stanza/iq/jabber:iq:auth:query", function(event) local session, stanza = event.origin, event.stanza; if session.type ~= "c2s_unauthed" then - session.send(st.error_reply(stanza, "cancel", "service-unavailable", "Legacy authentication is only allowed for unauthenticated client connections.")); + (session.sends2s or session.send)(st.error_reply(stanza, "cancel", "service-unavailable", "Legacy authentication is only allowed for unauthenticated client connections.")); return true; end @@ -57,7 +57,6 @@ module:hook("stanza/iq/jabber:iq:auth:query", function(event) username, password, resource = t_concat(username), t_concat(password), t_concat(resource); username = nodeprep(username); resource = resourceprep(resource) - local reply = st.reply(stanza); if not (username and resource) then session.send(st.error_reply(stanza, "modify", "bad-request")); return true;