diff --git a/client/pages/_middleware.tsx b/client/pages/_middleware.tsx index dc514ca5..480feb92 100644 --- a/client/pages/_middleware.tsx +++ b/client/pages/_middleware.tsx @@ -12,7 +12,7 @@ export function middleware(req: NextRequest) { // header added when next/link pre-fetches a route !req.headers.get('x-middleware-preflight') - if (pathname === '/signout') { + if (!req.headers.get('x-middleware-preflight') && pathname === '/signout') { // If you're signed in we remove the cookie and redirect to the home page // If you're not signed in we redirect to the home page if (signedIn) {