This commit is contained in:
parent
7bc9fca4c4
commit
42efbc232b
|
@ -33,18 +33,21 @@ func IsRegisteredResolver(ctx context.Context, email string) (*model.Response, e
|
|||
} else {
|
||||
log.Debug("Found user by email: ", existingUser)
|
||||
if existingUser != nil {
|
||||
if strings.Contains(existingUser.SignupMethods, "magic") {
|
||||
res.Message = "registered"
|
||||
if existingUser.EmailVerifiedAt != nil {
|
||||
res.Message = "verified"
|
||||
log.Debug("Email is already verified and signed up.")
|
||||
return res, nil
|
||||
} else if existingUser.ID != "" && existingUser.EmailVerifiedAt == nil {
|
||||
res.Message = "not verified"
|
||||
log.Debug("Email is already signed up. Verification pending...")
|
||||
return res, nil
|
||||
}
|
||||
}
|
||||
if strings.Contains(existingUser.SignupMethods, "magic") && !strings.Contains(existingUser.SignupMethods, "basic") {
|
||||
res.Message = "registered"
|
||||
} else if existingUser.EmailVerifiedAt != nil {
|
||||
res.Message = "verified"
|
||||
log.Debug("Email is already verified and signed up.")
|
||||
return res, nil
|
||||
} else if existingUser.ID != "" && existingUser.EmailVerifiedAt == nil {
|
||||
res.Message = "not verified"
|
||||
log.Debug("Email is already signed up. Verification pending...")
|
||||
return res, nil
|
||||
} else {
|
||||
res.Message = "unknown"
|
||||
log.Debug("Unknown signup method.")
|
||||
return res, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user