fix(SW-236): add returnUrl to refresh
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { headers } from "next/headers"
|
||||
import { notFound, redirect } from "next/navigation"
|
||||
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
@@ -28,7 +29,11 @@ export default async function ContentTypePage({
|
||||
case "unauthorized": // fall through
|
||||
case "forbidden": // fall through
|
||||
case "token_expired":
|
||||
redirect(`/${getLang()}/webview/refresh`)
|
||||
const h = headers()
|
||||
const returnURL = `/${getLang()}/webview${h.get("x-pathname")!}`
|
||||
redirect(
|
||||
`/${getLang()}/webview/refresh?returnUrl=${encodeURIComponent(returnURL)}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user