invalid email

default discord avatar
6 months ago

not sure what is the problem here. I can add the first one, but this error show up trying to create another

  • default discord avatar
    6 months ago

    it can happens to me sometimes, i just had to refresh the tab

  • default discord avatar
    6 months ago


  • default discord avatar
    6 months ago

    @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


    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.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.