aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-09-29 19:54:31 +0100
committerMatthew Wild <mwild1@gmail.com>2009-09-29 19:54:31 +0100
commitd937a3e04370ddb4a3bbb172e152b89ce8036cfd (patch)
treea74badc0674946f9c85df1432b0f21a74b978c5c
parente094c8b08b002896c440c3b55785bcf119007c91 (diff)
downloadprosody-d937a3e04370ddb4a3bbb172e152b89ce8036cfd.tar.gz
prosody-d937a3e04370ddb4a3bbb172e152b89ce8036cfd.zip
mod_saslauth: Prep username used for authenticating a session
-rw-r--r--plugins/mod_saslauth.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 32269221..f196e483 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -52,14 +52,14 @@ local function handle_status(session, status)
if status == "failure" then
session.sasl_handler = nil;
elseif status == "success" then
- if not session.sasl_handler.username then -- TODO move this to sessionmanager
+ local username = nodeprep(session.sasl_handler.username);
+ session.sasl_handler = nil;
+ if not username then -- TODO move this to sessionmanager
module:log("warn", "SASL succeeded but we didn't get a username!");
- session.sasl_handler = nil;
session:reset_stream();
return;
end
- sm_make_authenticated(session, session.sasl_handler.username);
- session.sasl_handler = nil;
+ sm_make_authenticated(session, username);
session:reset_stream();
end
end