Diff

plugins/mod_invites.lua @ 13851:ecafafec7806 13.0

mod_invites: Consider password reset a distinct type wrt invite page This should prevent returning an invite web page unless it supports password resets.
author Kim Alvefur <zash@zash.se>
date Tue, 15 Apr 2025 21:47:13 +0200
parent 13741:e9edf9b50f32
line wrap: on
line diff
--- a/plugins/mod_invites.lua	Wed Apr 16 12:02:31 2025 +0100
+++ b/plugins/mod_invites.lua	Tue Apr 15 21:47:13 2025 +0200
@@ -221,7 +221,11 @@
 	-- Determine whether this type of invitation is supported by the landing page
 	local invite_type;
 	if invite.type == "register" then
-		invite_type = "account";
+		if invite.additional_data and invite.additional_data.allow_reset then
+			invite_type = "password-reset";
+		else
+			invite_type = "account";
+		end
 	elseif invite.type == "roster" then
 		if invite.allow_registration then
 			invite_type = "account-and-contact";