docs: custom auth strategy requires the collection slug in return value (#11327)

This commit is contained in:
Violet Rosenzweig
2025-02-28 13:30:29 -05:00
committed by GitHub
parent 206b4b9d88
commit fcaf59176d

View File

@@ -62,9 +62,12 @@ export const Users: CollectionConfig = {
})
return {
// Send the user back to authenticate,
// Send the user with the collection slug back to authenticate,
// or send null if no user should be authenticated
user: usersQuery.docs[0] || null,
user: usersQuery.docs[0] ? {
collection: 'users'
...usersQuery.docs[0],
} : null,
// Optionally, you can return headers
// that you'd like Payload to set here when