diff plugins/mod_legacyauth.lua @ 10557:e1cb869e2f6c

mod_legacyauth: Report failure from sessionmanager (mostly invalid username)
author Kim Alvefur <zash@zash.se>
date Mon, 23 Dec 2019 23:11:28 +0100
parents bd88ca43d77a
children a80314101bc6
line wrap: on
line diff
--- 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