Comparison

plugins/mod_component.lua @ 4806:27a99c289b90

mod_component: Allow unauthenticated components to authenticate (thanks Maranda)
author Matthew Wild <mwild1@gmail.com>
date Mon, 30 Apr 2012 01:20:13 +0100
parent 4805:1aeece2cc814
child 4993:5243b74a4cbb
comparison
equal deleted inserted replaced
4805:1aeece2cc814 4806:27a99c289b90
41 41
42 -- Handle authentication attempts by component 42 -- Handle authentication attempts by component
43 local function handle_component_auth(event) 43 local function handle_component_auth(event)
44 local session, stanza = event.origin, event.stanza; 44 local session, stanza = event.origin, event.stanza;
45 45
46 if session.type ~= "component" then return; end 46 if session.type ~= "component_unauthed" then return; end
47 47
48 if (not session.host) or #stanza.tags > 0 then 48 if (not session.host) or #stanza.tags > 0 then
49 (session.log or log)("warn", "Invalid component handshake for host: %s", session.host); 49 (session.log or log)("warn", "Invalid component handshake for host: %s", session.host);
50 session:close("not-authorized"); 50 session:close("not-authorized");
51 return true; 51 return true;