Skip to content

Duplication of email field when using local strategy #29

Closed
@yakubovmax213

Description

@yakubovmax213

Plugin version

0.8.0

Payload version

3.33.0

Auth.js version

5.0.0-beta.25

Describe the bug

Thanks for building a great library and for implementing a new feature with support for a local authentication strategy!

I noticed incorrect behavior when running examples/with-payload-local-strategy-example.
If we pass enableLocalStrategy: true to the authjsPlugin function, we see a duplicate email field in the Users collection when we run the application. Authentication works correctly and the data in the database is also created without duplication, but the email field is duplicated in the UI.

Looking a bit into the source code of your library and into the Payload code I see that the email field in generalFields is created by you, although Payload itself also creates this field here. I think that the two fields are not merged and are in conflict.

To Reproduce

  1. Run examples/with-payload-local-strategy-example
  2. Log in with OAuth or local strategy
  3. Go to http://localhost:3000/admin/collections/users
  4. See duplicate email field in the table and error about non-unique React keys

Additional context / Screenshots

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus: verifiedIf an issue has been reproduced

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions