From fcaf59176df315630b32bd480a0ded307aa10134 Mon Sep 17 00:00:00 2001 From: Violet Rosenzweig Date: Fri, 28 Feb 2025 13:30:29 -0500 Subject: [PATCH] docs: custom auth strategy requires the collection slug in return value (#11327) --- docs/authentication/custom-strategies.mdx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/authentication/custom-strategies.mdx b/docs/authentication/custom-strategies.mdx index c8fdb2dbd..f42973b35 100644 --- a/docs/authentication/custom-strategies.mdx +++ b/docs/authentication/custom-strategies.mdx @@ -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