Like what we’re doing? Star us on GitHub!

invalid email

ativeretalbe
2 weeks ago
3

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

Screenshot_from_2023-03-08_14-47-30.png
Screenshot_from_2023-03-08_14-52-33.png
  • Britik
    2 weeks ago

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

  • Bakry
    2 weeks ago

    same

  • Jarrod
    Payload Team
    2 weeks 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

    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.

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More