I've been banging my head against a wall for a couple of days now but I'm really struggling with integrating auth correctly in the V3 beta. I'm creating the payload object with const payload = await getPayloadHMR({ config: payloadConfig })
Then I have no idea what to pass in payload.auth() all of the docs say its req, res but I'm assuming thats changed since the move to Next as that's not available? if anyone could point me in the right direction that would be incredible.
Just as a note I'm doing this within an api route in my custom app. And a user has been created and the payload-token JWT / HTTP Cookie has been created
For anyone else that needs help with it... Although it might just be me being dense... here's the solution:
const payload = await getPayloadHMR({ config: payloadConfig })
const user = await payload.auth({ headers: request.headers })
Star
Discord
online
Get dedicated engineering support directly from the Payload team.