mod_legacyauth: Report failure from sessionmanager (mostly invalid username)
authorKim Alvefur <zash@zash.se>
Mon, 23 Dec 2019 23:11:28 +0100
changeset 10561 e1cb869e2f6c
parent 10560 79fe4ed1332b
child 10562 40c2500208f4
mod_legacyauth: Report failure from sessionmanager (mostly invalid username)
plugins/mod_legacyauth.lua
--- a/plugins/mod_legacyauth.lua	Mon Dec 23 22:30:21 2019 +0100
+++ b/plugins/mod_legacyauth.lua	Mon Dec 23 23:11:28 2019 +0100
@@ -78,8 +78,10 @@
 					session:close(); -- FIXME undo resource bind and auth instead of closing the session?
 					return true;
 				end
+				session.send(st.reply(stanza));
+			else
+				session.send(st.error_reply(stanza, "auth", "not-authorized", err));
 			end
-			session.send(st.reply(stanza));
 		else
 			session.send(st.error_reply(stanza, "auth", "not-authorized"));
 		end