plugins/mod_legacyauth.lua
changeset 6302 76699a0ae4c4
parent 5776 bd0ff8ae98a8
child 6490 edc63dc72566
--- a/plugins/mod_legacyauth.lua	Fri Jul 04 21:48:25 2014 +0200
+++ b/plugins/mod_legacyauth.lua	Fri Jul 04 22:52:34 2014 +0200
@@ -44,9 +44,10 @@
 		return true;
 	end
 
-	local username = stanza.tags[1]:child_with_name("username");
-	local password = stanza.tags[1]:child_with_name("password");
-	local resource = stanza.tags[1]:child_with_name("resource");
+	local query = stanza.tags[1];
+	local username = query:get_child("username");
+	local password = query:get_child("password");
+	local resource = query:get_child("resource");
 	if not (username and password and resource) then
 		local reply = st.reply(stanza);
 		session.send(reply:query("jabber:iq:auth")