aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_legacyauth.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_legacyauth.lua b/plugins/mod_legacyauth.lua
index f1ffef34..8bff51fe 100644
--- a/plugins/mod_legacyauth.lua
+++ b/plugins/mod_legacyauth.lua
@@ -19,7 +19,12 @@ local usermanager = require "core.usermanager";
module:add_feature("jabber:iq:auth");
module:add_event_hook("stream-features", function (session, features)
- if not session.username then features:tag("auth", {xmlns='http://jabber.org/features/iq-auth'}):up(); end
+ if secure_auth_only and not session.secure then
+ -- Sorry, not offering to insecure streams!
+ return;
+ elseif not session.username then
+ features:tag("auth", {xmlns='http://jabber.org/features/iq-auth'}):up();
+ end
end);
module:add_iq_handler("c2s_unauthed", "jabber:iq:auth",