Get new JWT in Next 13

Hi everyone,

I am using Auth0 with NextJS 13 and the app router.

I need to create a new token_id (JWT token) inside a protected route page every time the user access the page. It needs to be signed with the Auth0 secret.

Do you have any suggestion on how I can achieve it?

P.S.: using the Auth0 helper “getSession()” doesn’t work since it always returns the same JWT.

Thank you

Hey there @Sapessi welcome to the community!

I’m not sure it’s possible to get a new access token dynamically/silently similar to the way a front end SDK like auth0-react does:

https://community.auth0.com/t/with-nextjs-auth0-how-can-i-get-an-access-token-with-a-different-audience-than-i-passed-during-the-login/112287

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.