Users Collection ID Field #39
Unanswered
jpgrusling
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hey, Auth.js generates the user ID with I tried a bit and if I remove my custom ID field, Payload will ignore the provided ID from Auth.js and generate an
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to add this plugin to an existing project with existing admin users. The project uses MongoDB for the storage. User IDs in the database are persisted as ObjectIds. When using this plugin while enabling the built in Payload auth, I am unable to log in. I get a successful response from the login endpoint and a cookie. However I remain at the login screen. Upon further investigation, it appears related to the fact that the ID field of the users collection is an ObjectId instead of a string. I am able to log in if I change the data for in the database. I am curious if there is a reason why you chose to explicitly define the ID field. I would be glad to review the code and submit a PR if this choice wasn't made deliberately. However if this was an intentional choice that you'd like to keep then there's no reason for me to investigate.
Beta Was this translation helpful? Give feedback.
All reactions