mod_log_auth: Attempt to retrieve attempted username from SASL handler (re #844)
authorKim Alvefur <zash@zash.se>
Wed, 19 Apr 2017 06:37:29 +0200
changeset 2700 404d47d2e833
parent 2699 8b21f13b08c5
child 2701 d18a91c030df
mod_log_auth: Attempt to retrieve attempted username from SASL handler (re #844)
mod_log_auth/mod_log_auth.lua
--- a/mod_log_auth/mod_log_auth.lua	Wed Apr 19 06:36:52 2017 +0200
+++ b/mod_log_auth/mod_log_auth.lua	Wed Apr 19 06:37:29 2017 +0200
@@ -6,7 +6,7 @@
 	module:hook("authentication-failure", function (event)
 		local session = event.session;
 		module:log("info", "Failed authentication attempt (%s) for user %s from IP: %s",
-			event.condition or "unknown-condition", session.username or "?", session.ip or "?");
+			event.condition or "unknown-condition", session.username or session.sasl_handler.username or "?", session.ip or "?");
 	end);
 end