diff --git a/apps/server/src/env.ts b/apps/server/src/env.ts index b19eb6f0..c13bb769 100644 --- a/apps/server/src/env.ts +++ b/apps/server/src/env.ts @@ -15,6 +15,7 @@ export const env = createEnv({ JITSU_HOST: z.string().optional(), SCREENSHOT_SERVICE_URL: z.string(), QSTASH_TOKEN: z.string(), + NODE_ENV: z.string().default("development"), }, /** diff --git a/apps/server/src/v1/middleware.ts b/apps/server/src/v1/middleware.ts index c0bbedc4..0486b013 100644 --- a/apps/server/src/v1/middleware.ts +++ b/apps/server/src/v1/middleware.ts @@ -5,6 +5,7 @@ import { db, eq } from "@openstatus/db"; import { selectWorkspaceSchema, workspace } from "@openstatus/db/src/schema"; import { getPlanConfig } from "@openstatus/db/src/schema/plan/utils"; import { HTTPException } from "hono/http-exception"; +import { env } from "../env"; import type { Variables } from "./index"; export async function middleware( @@ -15,7 +16,7 @@ export async function middleware( if (!key) throw new HTTPException(401, { message: "Unauthorized" }); const { error, result } = - process.env.NODE_ENV === "production" + env.NODE_ENV === "production" ? await verifyKey(key) : { result: { valid: true, ownerId: "1" }, error: null }; diff --git a/apps/web/src/app/api/og/_components/basic-layout.tsx b/apps/web/src/app/api/og/_components/basic-layout.tsx index b299c8a7..0f3608ef 100644 --- a/apps/web/src/app/api/og/_components/basic-layout.tsx +++ b/apps/web/src/app/api/og/_components/basic-layout.tsx @@ -28,7 +28,7 @@ export function BasicLayout({