Fix: break out pages to dynamic route
This commit is contained in:
@@ -2,7 +2,6 @@ import { TRPCError } from "@trpc/server"
|
||||
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 +23,6 @@ export function serverClient() {
|
||||
if (error.code === "UNAUTHORIZED") {
|
||||
const lang = ctx?.lang || Lang.en
|
||||
if (ctx?.webToken) {
|
||||
console.log({ ctx })
|
||||
const returnUrl = ctx.url
|
||||
|
||||
const redirectUrl = `/${lang}/webview/refresh?returnurl=${encodeURIComponent(returnUrl)}`
|
||||
@@ -35,8 +33,6 @@ export function serverClient() {
|
||||
redirect(redirectUrl)
|
||||
}
|
||||
|
||||
console.error("Unautorized on web, redirecting to login")
|
||||
|
||||
const pathname = ctx?.pathname || "/"
|
||||
redirect(
|
||||
`/${lang}/login?redirectTo=${encodeURIComponent(`/${lang}/${pathname}`)}`
|
||||
|
||||
Reference in New Issue
Block a user