Harden email verification resend against abuse
Add a per-address confirmation-email cooldown and disable the resend/forgot-password submit buttons while the mutation is in flight so callers cannot flood the mail queue or double-submit. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -100,7 +100,7 @@ func NewPresenter(baseURL string, fullName string) *Presenter {
|
||||
}
|
||||
|
||||
const (
|
||||
subjectConfirmEmail = "Confirm your email address"
|
||||
SubjectConfirmEmail = "Confirm your email address"
|
||||
subjectPasswordReset = "Reset your password"
|
||||
subjectInvitation = "Invitation to join %s on Probo"
|
||||
subjectDocumentApproval = "Action Required – Please review and approve %s compliance documents"
|
||||
@@ -185,7 +185,7 @@ func (p *Presenter) RenderConfirmEmail(ctx context.Context, confirmationURLPath
|
||||
|
||||
textBody, htmlBody, err = renderEmail(confirmEmailTextTemplate, confirmEmailHTMLTemplate, data)
|
||||
|
||||
return subjectConfirmEmail, textBody, htmlBody, err
|
||||
return SubjectConfirmEmail, textBody, htmlBody, err
|
||||
}
|
||||
|
||||
func (p *Presenter) RenderPasswordReset(ctx context.Context, resetPasswordURLPath string, resetPasswordToken string) (subject string, textBody string, htmlBody *string, err error) {
|
||||
|
||||
Reference in New Issue
Block a user