fix: send searchparams in rewrite
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { TRPCError } from "@trpc/server"
|
||||
import { redirect } from "next/navigation"
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { env } from "@/env/server"
|
||||
import { appRouter } from "@/server"
|
||||
import { createContext } from "@/server/context"
|
||||
import { internalServerError } from "@/server/errors/next"
|
||||
@@ -30,10 +32,12 @@ export function serverClient() {
|
||||
"Unautorized in webview, redirecting to: ",
|
||||
redirectUrl
|
||||
)
|
||||
|
||||
redirect(redirectUrl)
|
||||
}
|
||||
|
||||
const pathname = ctx?.pathname || "/"
|
||||
|
||||
redirect(
|
||||
`/${lang}/login?redirectTo=${encodeURIComponent(`/${lang}/${pathname}`)}`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user