diff mod_sasl2/mod_sasl2.lua @ 5023:90772a9c92a0

mod_sasl2: Include additional-data in SASL success response
author Matthew Wild <mwild1@gmail.com>
date Sun, 28 Aug 2022 15:03:58 +0100
parents f62b091b1c81
children fd154db7c8fc
line wrap: on
line diff
--- a/mod_sasl2/mod_sasl2.lua	Sun Aug 28 15:50:39 2022 +0200
+++ b/mod_sasl2/mod_sasl2.lua	Sun Aug 28 15:03:58 2022 +0100
@@ -94,6 +94,9 @@
 		return true;
 	end
 	event.success = st.stanza("success", { xmlns = xmlns_sasl2 });
+	if event.message then
+		event.success:text_tag("additional-data", base64.encode(event.message));
+	end
 end, 1000);
 
 module:hook("sasl2/c2s/success", function (event)