fix: redirect users to /refresh on unauth and mod webview links

This commit is contained in:
Christel Westerberg
2024-05-16 16:57:22 +02:00
parent 777fd1e5b6
commit 9e4f41ee46
29 changed files with 358 additions and 105 deletions
+2 -1
View File
@@ -42,7 +42,7 @@ export const middleware: NextMiddleware = async (request) => {
return NextResponse.rewrite(
new URL(
`/${lang}/preview/${contentType}/${uid}?${searchParams.toString()}`,
`/${lang}/preview/${contentType}?${searchParams.toString()}`,
nextUrl
),
{
@@ -53,6 +53,7 @@ export const middleware: NextMiddleware = async (request) => {
)
}
searchParams.set("uri", pathNameWithoutLang)
if (isCurrent) {
searchParams.set("uri", pathNameWithoutLang)
return NextResponse.rewrite(