diff --git a/src/next/middleware.ts b/src/next/middleware.ts index e6f6015..c61b675 100644 --- a/src/next/middleware.ts +++ b/src/next/middleware.ts @@ -157,7 +157,9 @@ export async function authMiddleware( debug('Handle request', {path: request.nextUrl.pathname}); if ( - [options.loginPath, options.logoutPath].includes(request.nextUrl.pathname) + [options.loginPath, options.logoutPath, options.refreshTokenPath] + .filter(Boolean) + .includes(request.nextUrl.pathname) ) { debug('Handle authentication API route'); return createAuthMiddlewareResponse(request, options);