Unique usernames but not unique emails
-
We have a question about user uniqueness.
We want to have multiple users with unique usernames, but duplicate email addresses.
When creating some users, we found FusionAuth wants unique usernames and email addresses. Is there a way to have usernames be unique, but not emails?
-
The recommended course of action is to store the email in the
user.data.email
field, which is not required to be unique but is still used for activities like 'forgot password' emails. Leave theuser.email
field blank and useuser.username
.That should work. Support for
user.data.email
was removed in 1.26 and added back in 1.27.2, so avoid version 1.26.* and 1.27.0 and 1.27.1. -