Cannot update session

Hello, please help me with the problem.

On project we use Auth0 and Next.js. Thus, also @auth0/nextjs-auth0 is used. User creates account with Auth0, then after passing the onboarding a newcomer gets a new role. However the role is unavailable on the frontend and as a result our backend doesn’t accept requests and returns 403 error. It is because the token got when user signed in is still used.

The session object I got with getSession stays unchanged, the role there is empty. Everything works well only if user logs out and logs in again and, as a result, the session object also updates and the user gets a role. Only then all processes continue to work as they were predicted.

What should be done? I sent request to get a new token and added it to session object but no result was brought. What should be done to update session? Or maybe problem even is not in session?

1 Like

@rio.h we use the updateSession method in our project. Here’s their documentation:

I’m troubleshooting some issues with that at the moment, which is why I came across your question.

2 Likes