payloadcms / payload

The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.
https://payloadcms.com
MIT License
21.1k stars 1.27k forks source link

Disabling auth local strategy causes /api/users/me to no longer work #6969

Open riley-pearce-airteam opened 5 days ago

riley-pearce-airteam commented 5 days ago

Link to reproduction

No response

Payload Version

3.0.0-beta.55

Node Version

20.15.0

Next.js Version

15.0.0-rc.0

Describe the Bug

In v2 I created a custom OAuth2.0 flow to generate a payload-token cookie. This was the only source of authentication so I would set disableLocalStrategy: true, everything worked as expected.

In v3, if I set disableLocalStrategy: true, the /api/users/me endpoint will return user as null when using the OAuth2.0 generated cookie. If I omit disableLocalStrategy: true, that same cookie will return as expected from /api/users/me.

Please note I'm not using strategies in the auth object; this wasn't necessary in v2.

Reproduction Steps

Adapters and Plugins

@payloadcms/db-postgres, @payloadcms/next, @payloadcms/richtext-lexical