Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Verify user JWT from NextJS side

default discord avatar
hayskapoylast year
3

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"))

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.