Set username on SASL success

Sun, 16 Nov 2008 00:25:28 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 16 Nov 2008 00:25:28 +0500
changeset 287
5c405d7b06bb
parent 284
4f540755260c
child 289
3c8a28c1f331

Set username on SASL success

plugins/mod_saslauth.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_saslauth.lua	Sat Nov 15 23:20:07 2008 +0500
+++ b/plugins/mod_saslauth.lua	Sun Nov 16 00:25:28 2008 +0500
@@ -34,6 +34,8 @@
 	if status == "failure" then
 		session.sasl_handler = nil;
 	elseif status == "success" then
+		if not session.sasl_handler.username then error("SASL succeeded but we didn't get a username!"); end -- TODO move this to sessionmanager
+		sessionmanager.make_authenticated(session, session.sasl_handler.username);
 		session.sasl_handler = nil;
 		session:reset_stream();
 	end

mercurial