Skip to content

Commit 865b5bb

Browse files
committed
add proper message for missing email address
1 parent 65b874b commit 865b5bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/api/identity.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ func (a *API) linkIdentityToUser(r *http.Request, ctx context.Context, tx *stora
133133
return nil, terr
134134
}
135135
if !userData.Metadata.EmailVerified {
136+
if targetUser.GetEmail() == "" {
137+
// empty email address is regarded as not verified
138+
return nil, apierrors.NewUnprocessableEntityError(apierrors.ErrorCodeEmailNotConfirmed, "No email address provided by %v. Please add a verified email address to your account at %v and try again.", providerType, providerType)
139+
}
140+
136141
if terr := a.sendConfirmation(r, tx, targetUser, models.ImplicitFlow); terr != nil {
137142
return nil, terr
138143
}

0 commit comments

Comments
 (0)