2 local st = require "util.stanza"; |
2 local st = require "util.stanza"; |
3 local t_concat = table.concat; |
3 local t_concat = table.concat; |
4 |
4 |
5 require "core.discomanager".set("legacyauth", "jabber:iq:auth"); |
5 require "core.discomanager".set("legacyauth", "jabber:iq:auth"); |
6 |
6 |
7 add_iq_handler("c2s_unauthed", "jabber:iq:auth", |
7 module:add_iq_handler("c2s_unauthed", "jabber:iq:auth", |
8 function (session, stanza) |
8 function (session, stanza) |
9 local username = stanza.tags[1]:child_with_name("username"); |
9 local username = stanza.tags[1]:child_with_name("username"); |
10 local password = stanza.tags[1]:child_with_name("password"); |
10 local password = stanza.tags[1]:child_with_name("password"); |
11 local resource = stanza.tags[1]:child_with_name("resource"); |
11 local resource = stanza.tags[1]:child_with_name("resource"); |
12 if not (username and password and resource) then |
12 if not (username and password and resource) then |