Merged in fix/SW-236-webview-refresh-token (pull request #426)
fix(SW-236): add returnUrl to refresh Approved-by: Pontus Dreij
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { headers } from "next/headers"
|
||||||
import { notFound, redirect } from "next/navigation"
|
import { notFound, redirect } from "next/navigation"
|
||||||
|
|
||||||
import { serverClient } from "@/lib/trpc/server"
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
@@ -28,7 +29,11 @@ export default async function ContentTypePage({
|
|||||||
case "unauthorized": // fall through
|
case "unauthorized": // fall through
|
||||||
case "forbidden": // fall through
|
case "forbidden": // fall through
|
||||||
case "token_expired":
|
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