not sure what is the problem here. I can add the first one, but this error show up trying to create another
it can happens to me sometimes, i just had to refresh the tab
same
@ativeretalbe You likely created the collection with
auth: true
and then later changed it to false.
TLDR; delete the email index from your collection in mongodb.
The reason this happens is bc
auth: true
adds the field
email
behind the scenes, this field is created with a unique index. Payload will not remove old indexes, you will have to do that manually.
The reason you can create 1 user, is because they have no email, then the second user creation is attempted with the same blank email, not unique and it fails. Delete the index on the email field in mongodb and it should resolve your issues.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.