X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_legacyauth.lua;h=47a8c0abb007edc8dc74f64702172b4583e8e502;hb=b5de954ba80a4f56777b3650585103864bb96ba5;hp=95f361104383fcedf28059663096c9b807082488;hpb=c69f2eb4c2a197231a67c1c2db155202395c8980;p=prosody.git diff --git a/plugins/mod_legacyauth.lua b/plugins/mod_legacyauth.lua index 95f36110..47a8c0ab 100644 --- a/plugins/mod_legacyauth.lua +++ b/plugins/mod_legacyauth.lua @@ -32,6 +32,11 @@ end); 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.")); + return true; + end + if secure_auth_only and not session.secure then session.send(st.error_reply(stanza, "modify", "not-acceptable", "Encryption (SSL or TLS) is required to connect to this server")); return true;