aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-29 18:03:48 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-29 18:03:48 +0100
commit3c73c21bfcf38d9eb9d30c2604f921b51c3ef3c6 (patch)
tree3454125ac4cb9dd9f3a36c5ebc62891855bff2dd /plugins
parent4e00f6c8b5552993cdff250aa0946c0e71b136a0 (diff)
downloadprosody-3c73c21bfcf38d9eb9d30c2604f921b51c3ef3c6.tar.gz
prosody-3c73c21bfcf38d9eb9d30c2604f921b51c3ef3c6.zip
mod_saslauth: Don't offer bind/session when they aren't authenticated yet :) [thanks albert, again...]
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_saslauth.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index f226203e..78417c0f 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -121,7 +121,10 @@ local bind_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-bind' };
local xmpp_session_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-session' };
module:add_event_hook("stream-features",
function (session, features)
- if not session.username and ((not secure_auth_only) or session.secure) then
+ if not session.username then
+ if secure_auth_only and not session.secure then
+ return;
+ end
features:tag("mechanisms", mechanisms_attr);
-- TODO: Provide PLAIN only if TLS is active, this is a SHOULD from the introduction of RFC 4616. This behavior could be overridden via configuration but will issuing a warning or so.
if config.get(session.host or "*", "core", "anonymous_login") then