Like what we’re doing? Star us on GitHub!

Verify user JWT from NextJS side

last week

Hello! I'd like to verify the user JWT from payload (passed as a GET query param from the preview url) in NextJS but it seems like it is failing every time. I currently have the following code to verify using "jose".

import { jwtVerify } from "jose"

await jwtVerify(token, new TextEncoder().encode("my_secret_token"))

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More