I’m using NextAuth.js with JWT sessions and refresh tokens. When the access token expires, the refresh logic calls my backend API to get new tokens. Although the backend returns a new access token and refresh token, my app continues sending the old refresh token in subsequent requests. This causes the backend to respond with a 401 “Invalid Refresh Token” error, and the token refresh fails repeatedly.
I’m using NextAuth.js with JWT sessions and refresh tokens. When the access token expires, the refresh logic calls my backend API to get new tokens. Although the backend returns a new access token and refresh token, my app continues sending the old refresh token in subsequent requests. This causes the backend to respond with a 401 “Invalid Refresh Token” error, and the token refresh fails repeatedly.