Changeset

4504:55b61221ecb8

mod_saslauth: Move authentication-success event to after session has been made authenticated.
author Kim Alvefur <zash@zash.se>
date Sun, 12 Feb 2012 15:05:31 +0100
parents 4502:dd1eaecc11f9
children 4505:b1e10c327d66
files plugins/mod_saslauth.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Sat Feb 11 14:51:00 2012 +0000
+++ b/plugins/mod_saslauth.lua	Sun Feb 12 15:05:31 2012 +0100
@@ -51,11 +51,11 @@
 		module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg });
 		session.sasl_handler = session.sasl_handler:clean_clone();
 	elseif status == "success" then
-		module:fire_event("authentication-success", { session = session });
 		local username = nodeprep(session.sasl_handler.username);
 
 		local ok, err = sm_make_authenticated(session, session.sasl_handler.username);
 		if ok then
+			module:fire_event("authentication-success", { session = session });
 			session.sasl_handler = nil;
 			session:reset_stream();
 		else