fix: reload window on logout

This commit is contained in:
Christel Westerberg
2024-09-26 11:31:39 +02:00
parent b9aeb8ff30
commit 943184c50c
2 changed files with 14 additions and 4 deletions

View File

@@ -1,4 +1,3 @@
import { revalidatePath } from "next/cache"
import { NextRequest, NextResponse } from "next/server"
import { AuthError } from "next-auth"
@@ -95,9 +94,6 @@ export async function GET(
redirect: false,
})
// Revalidate the router cache for my pages to make sure we don't show stale user data
revalidatePath("/[lang]/my-pages", "layout")
if (redirectUrlObj) {
console.log(`[logout] redirecting to: ${redirectUrlObj.redirect}`)
return NextResponse.redirect(redirectUrlObj.redirect)