fix: enable benefits blocks
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { TRPCError } from "@trpc/server"
|
||||
import { headers } from "next/headers"
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { overview } from "@/constants/routes/webviews"
|
||||
import { appRouter } from "@/server"
|
||||
import { createContext } from "@/server/context"
|
||||
import { internalServerError } from "@/server/errors/next"
|
||||
@@ -24,7 +24,9 @@ export function serverClient() {
|
||||
if (error.code === "UNAUTHORIZED") {
|
||||
const lang = ctx?.lang || Lang.en
|
||||
if (ctx?.webToken) {
|
||||
const returnUrl = ctx.url
|
||||
console.log({ ctx })
|
||||
const returnUrl = ctx.pathname || overview[lang]
|
||||
|
||||
const redirectUrl = `/${lang}/webview/refresh?returnurl=${encodeURIComponent(returnUrl)}`
|
||||
console.error(
|
||||
"Unautorized in webview, redirecting to: ",
|
||||
|
||||
Reference in New Issue
Block a user