Skip to content

Commit

Permalink
fix reading emailOwner without checking if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Southclaws committed Nov 22, 2024
1 parent 34d3ace commit 5b28756
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/services/account/register/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,17 @@ func (s *Registrar) GetOrCreateViaEmail(
}

isVerified := func() bool {
if !emailExists {
return false
}

current, found := lo.Find(emailOwner.EmailAddresses, func(e *account.EmailAddress) bool {
return e.Email.Address == email.Address
})
if !found {
return false
}

return current.Verified
}()

Expand Down

0 comments on commit 5b28756

Please sign in to comment.