aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_saslauth.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-08-29 12:01:42 -0400
committerMatthew Wild <mwild1@gmail.com>2011-08-29 12:01:42 -0400
commitb17dbe08c55d3f6ff76ea55c0742d903f47288eb (patch)
treefae44e707320a3687e086ef54f315ce8c95b5c40 /plugins/mod_saslauth.lua
parentf34c346ad0677b1dc9e3e5ea9cd3f242237f1a0c (diff)
downloadprosody-b17dbe08c55d3f6ff76ea55c0742d903f47288eb.tar.gz
prosody-b17dbe08c55d3f6ff76ea55c0742d903f47288eb.zip
mod_saslauth: Fire authentication-success and authentication-failure events (thanks scitor)
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r--plugins/mod_saslauth.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 1c0d0673..8fd71ff3 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -48,8 +48,10 @@ end
local function handle_status(session, status, ret, err_msg)
if status == "failure" then
+ 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);