Get Access Token error

I have a NextJS app that I’ve integrated with Auth0. I was retrieving an access token without issue when the user logs in using the getAccessToken async function from @auth0/nextjs-auth0 that I have as a call using a local route that I’ve created. However, recently I’ve been getting an error message now. I am using the free version and I’ve changed some settings in relation to MFA but since reverted the settings back to the original since I’ve got this message. I’ve also tried a different tenant altogether and changed the env vars to reflect the new app and still getting the same error message. I’ve also made changes in my repo but have tried different branches prior to the changes with the same result. I’m not sure what the cause is. Would anything have any idea? The error message is as follows:

    "digest": "DYNAMIC_SERVER_USAGE"

Hey there @gperezcidra welcome to the community!

I just did some searching internally and wasn’t able to come up with anything related to that error :confused: I did stumble across this stackoverflow post which leads me to believe it might have more to do with NextJS than Auth0:

1 Like

Hey @tyf, I appreciate your warm welcome and contribution to my question. I’m going to try out the solution that they posted in that Stack Overflow article and let you know how it goes. Thanks!

1 Like

Hi @tyf, that was the solution after all. The user in the article suggested to add export const dynamic = "force-dynamic"; it to the top root layout page. However, I had to also add it to the API route in relation to the access token retrieval call that I’m making to Auth0 from that route as well and it is now responding back with the access token on the server app as well. Thank you so much!

1 Like

Hey @gperezcidra that’s great to know, thanks for sharing with the rest of the community! :slight_smile:

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