client: stop middleware from signing out on /signout pre-fetch
This commit is contained in:
parent
52dc5e41a5
commit
5e9288e9fb
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue