You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the middleware setup instructions. If I leave a web app running overnight with inactivity, routes start triggering this error in the middleware.
Reproduction
ResponseBodyError: server responded with an error in the response body
at async middleware (middleware.ts:8:18)
6 |
7 | export async function middleware(request: NextRequest) {
> 8 | const authRes = await auth0.middleware(request);
| ^
9 |
10 | // authentication routes — let the middleware handle it
11 | if (request.nextUrl.pathname.startsWith("/auth")) { {
code: 'OAUTH_RESPONSE_BODY_ERROR',
error: 'invalid_grant',
status: 403,
error_description: 'Unknown or invalid refresh token.'
Additional context
No response
nextjs-auth0 version
v4.0.0-beta.12
Next.js version
15.1.1
Node.js version
v20.17.0
The text was updated successfully, but these errors were encountered:
Hey @chris-erickson 👋 Thanks for the feedback! We're addressing this as part of another set of fixes around fetching and refreshing access tokens (linked above).
We'll be moving away from automatically refreshing access tokens in the middleware so this should fix the issue you're reporting.
This should be fixed in the latest release (4.0.0-beta.13). We've moved the access token refresh handling from the middleware to the getAccessToken handler so you should no longer be running into this issue after upgrading. Thanks for reporting this!
Checklist
Description
I followed the middleware setup instructions. If I leave a web app running overnight with inactivity, routes start triggering this error in the middleware.
Reproduction
Additional context
No response
nextjs-auth0 version
v4.0.0-beta.12
Next.js version
15.1.1
Node.js version
v20.17.0
The text was updated successfully, but these errors were encountered: