Software /
code /
prosody
Diff
plugins/mod_saslauth.lua @ 11512:a2ba6c0ac8ec 0.11
mod_saslauth: Improve code style
This many returns deserve their own line.
`session["sasl_handler"]` style isn't used anywhere else.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Mar 2021 16:17:45 +0100 |
parent | 11508:f1abc34414bc |
child | 11513:549c80feede6 |
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua Thu Mar 18 16:24:46 2021 +0100 +++ b/plugins/mod_saslauth.lua Thu Mar 18 16:17:45 2021 +0100 @@ -44,7 +44,9 @@ end local function handle_status(session, status, ret, err_msg) - if session["sasl_handler"] == nil then return "failure", "connection-timeout", "Connection gone"; end + if not session.sasl_handler then + return "failure", "connection-timeout", "Connection gone"; + end if status == "failure" then module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg }); session.sasl_handler = session.sasl_handler:clean_clone();