mod_saslauth: Fire authentication-failure if make_authenticated() failed.
[prosody.git] / plugins / mod_saslauth.lua
index 49987f84ff3905ab303051f5b108c7fd1cc87354..2b23e33c965bf23dbff9373ebfd192846bc7d723 100644 (file)
@@ -60,6 +60,7 @@ local function handle_status(session, status, ret, err_msg)
                        session:reset_stream();
                else
                        module:log("warn", "SASL succeeded but username was invalid");
+                       module:fire_event("authentication-failure", { session = session, condition = "not-authorized", text = err });
                        session.sasl_handler = session.sasl_handler:clean_clone();
                        return "failure", "not-authorized", "User authenticated successfully, but username was invalid";
                end