Fix: break out pages to dynamic route

This commit is contained in:
Christel Westerberg
2024-05-22 16:46:07 +02:00
parent ad5fb9c89d
commit c36578a83f
11 changed files with 78 additions and 51 deletions

View File

@@ -38,13 +38,6 @@ export function createContext() {
const cookie = cookies()
const webviewTokenCookie = cookie.get("webviewToken")
console.log("IN CONTEXT", {
lang: h.get("x-lang") as Lang,
pathname: h.get("x-pathname")!,
url: h.get("x-url")!,
webviewToken: cookie.get("webviewToken"),
})
return createContextInner({
auth,
lang: h.get("x-lang") as Lang,

View File

@@ -41,7 +41,7 @@ export const protectedProcedure = t.procedure.use(async function (opts) {
throw sessionExpiredError()
}
if (!session?.user || !opts.ctx.webToken) {
if (!session?.token.access_token && !opts.ctx.webToken) {
throw unauthorizedError()
}