client: redirect /private/ and /protected/ links to /post to handle backwards compat
This commit is contained in:
parent
67e1b9889b
commit
16d5780110
1 changed files with 5 additions and 0 deletions
|
@ -49,6 +49,11 @@ export function middleware(req: NextRequest, event: NextFetchEvent) {
|
|||
return NextResponse.redirect(getURL("signin"))
|
||||
}
|
||||
}
|
||||
|
||||
if (pathname.includes("/protected/") || pathname.includes("/private/")) {
|
||||
const urlWithoutVisibility = pathname.replace("/protected/", "/").replace("/private/", "/").substring(1)
|
||||
return NextResponse.redirect(getURL(urlWithoutVisibility))
|
||||
}
|
||||
}
|
||||
|
||||
return NextResponse.next()
|
||||
|
|
Loading…
Reference in a new issue