# HG changeset patch # User Matthew Wild # Date 1737042264 0 # Node ID 045abdc53ba4ccc4c91881b38ef8b1cfdcaac78b # Parent c90aab23fb9b8237b63effbea0300149508e39b3 mod_sasl2: Reset SASL handler after failed authentication mod_saslauth already does this, and we should be too. It allows re-attempting authentication after failure. diff -r c90aab23fb9b -r 045abdc53ba4 mod_sasl2/mod_sasl2.lua --- a/mod_sasl2/mod_sasl2.lua Sat Jan 11 12:12:18 2025 +0100 +++ b/mod_sasl2/mod_sasl2.lua Thu Jan 16 15:44:24 2025 +0000 @@ -125,6 +125,9 @@ module:hook("sasl2/c2s/failure", function (event) module:fire_event("authentication-failure", event); local session, condition, text = event.session, event.message, event.error_text; + + session.sasl_handler = session.sasl_handler:clean_clone(); + local failure = st.stanza("failure", { xmlns = xmlns_sasl2 }) :tag(condition, { xmlns = "urn:ietf:params:xml:ns:xmpp-sasl" }):up(); if text then