Skip to content

Commit b177a38

Browse files
authored
fix: send proper email change token in hook
1 parent fa90764 commit b177a38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/api/mail.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,14 @@ func (a *API) sendEmail(r *http.Request, tx *storage.Connection, u *models.User,
574574
externalURL := getExternalHost(ctx)
575575
if config.Hook.SendEmail.Enabled {
576576
emailData := mail.EmailData{
577-
Token: otp,
577+
Token: otpNew,
578578
EmailActionType: emailActionType,
579579
RedirectTo: referrerURL,
580580
SiteURL: externalURL.String(),
581581
TokenHash: tokenHashWithPrefix,
582582
}
583583
if emailActionType == mail.EmailChangeVerification && config.Mailer.SecureEmailChangeEnabled && u.GetEmail() != "" {
584-
emailData.TokenNew = otpNew
584+
emailData.TokenNew = otp
585585
emailData.TokenHashNew = u.EmailChangeTokenCurrent
586586
}
587587
input := hooks.SendEmailInput{

0 commit comments

Comments
 (0)