aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
commit8114fdc49e5437a8f3eb4a50c96976729ee7a211 (patch)
treefae44e707320a3687e086ef54f315ce8c95b5c40 /plugins
parent316cb51770cca1723c193aa095e0fa27ce10706c (diff)
downloadprosody-8114fdc49e5437a8f3eb4a50c96976729ee7a211.tar.gz
prosody-8114fdc49e5437a8f3eb4a50c96976729ee7a211.zip
mod_saslauth: Fire authentication-success and authentication-failure events (thanks scitor)
Diffstat (limited to 'plugins')
-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);