From 4bb1e901c664c79b8e583bf4f381b242af8d44ca Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Sun, 17 Oct 2021 17:45:19 +0200 Subject: [PATCH] fix wrong email address --- internal/processing/user/emailconfirm.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/processing/user/emailconfirm.go b/internal/processing/user/emailconfirm.go index 2a68ddd7a..0eb535730 100644 --- a/internal/processing/user/emailconfirm.go +++ b/internal/processing/user/emailconfirm.go @@ -31,7 +31,7 @@ import ( ) func (p *processor) SendConfirmEmail(ctx context.Context, user *gtsmodel.User, username string) error { - if user.UnconfirmedEmail == user.Email { + if user.UnconfirmedEmail == "" || user.UnconfirmedEmail == user.Email { // user has already confirmed this email address, so there's nothing to do return nil } @@ -60,8 +60,8 @@ func (p *processor) SendConfirmEmail(ctx context.Context, user *gtsmodel.User, u InstanceName: instance.Title, ConfirmLink: confirmationLink, } - if err := p.emailSender.SendConfirmEmail(user.Email, confirmData); err != nil { - return fmt.Errorf("SendConfirmEmail: error sending to email address %s belonging to user %s: %s", user.Email, username, err) + if err := p.emailSender.SendConfirmEmail(user.UnconfirmedEmail, confirmData); err != nil { + return fmt.Errorf("SendConfirmEmail: error sending to email address %s belonging to user %s: %s", user.UnconfirmedEmail, username, err) } // email sent, now we need to update the user entry with the token we just sent them