I run a platform built with the NextJS SDK for Auth0.
We implement the simple /api/auth/me and api/auth/login etc. API routes to handle user authentication and use the useUser hook to detect the existence of a user session.
Our users are constantly complaining that they have to login every 24 hours, and it seems to be because the accessToken expires after 24 hours.
I was reading this issue:
And I was wondering if we had to do something like:
To ensure that users can stay logged in for more than 24 hours. I’m not sure if we just missed something in our implementation or if something is broken.
Any help would be greatly appreciated!
-Will
I have the same issue also. Very surprising. I thought the whole point of using Auth0 and their SDKs was to not have to deal with implementing my own refresh token logic.
I’m also being told that our Next.js API routes are submitting expired tokens to our backend