Verify user JWT from NextJS side

default discord avatar
hayskapoy
8 months ago
4

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
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.