diff src/api/change_email_2.json.luan @ 59:02d8876dc41d

improve change email
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 29 Nov 2022 18:45:22 -0700
parents 31c895b73bd0
children
line wrap: on
line diff
--- a/src/api/change_email_2.json.luan	Tue Nov 29 16:09:17 2022 -0700
+++ b/src/api/change_email_2.json.luan	Tue Nov 29 18:45:22 2022 -0700
@@ -14,17 +14,17 @@
 return api(function()
 	local base_url = Http.request.parameters.base_url or user_error "missing base_url param"
 	local from = Http.request.parameters.from or user_error "missing from param"
-	local email = Http.request.parameters.email or user_error "missing email param"
+	local to = Http.request.parameters.to or user_error "missing to param"
 	local password = Http.request.parameters.password or user_error "missing password param"
 	local mailer = Mail.sender() or user_error "mail not configured"
 	mailer.send{
 		From = from
-		To = email
+		To = to
 		Subject = "Change Email"
 		body = output_of(function() %>
 Change your email address to this email by clicking this link:
 
-<%=base_url%>/change_email.html?email=<%=url_encode(email)%>&password2=<%=password%>
+<%=base_url%>/change_email.html?password=<%=password%>
 <%		end)
 	}
 	return {