Skip to content

Commit fcaf591

Browse files
authored
docs: custom auth strategy requires the collection slug in return value (#11327)
1 parent 206b4b9 commit fcaf591

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/authentication/custom-strategies.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ export const Users: CollectionConfig = {
6262
})
6363

6464
return {
65-
// Send the user back to authenticate,
65+
// Send the user with the collection slug back to authenticate,
6666
// or send null if no user should be authenticated
67-
user: usersQuery.docs[0] || null,
67+
user: usersQuery.docs[0] ? {
68+
collection: 'users'
69+
...usersQuery.docs[0],
70+
} : null,
6871

6972
// Optionally, you can return headers
7073
// that you'd like Payload to set here when

0 commit comments

Comments
 (0)