From d081c22f67bdde49211ac6053011901c616f99d6 Mon Sep 17 00:00:00 2001 From: Amadeusz Winogrodzki Date: Sat, 15 Jun 2024 20:14:27 +0200 Subject: [PATCH] fix: enable refresh token route --- src/next/middleware.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);