feat: integrate @t3-oss/env for environment variable management across the application

This commit is contained in:
tranminhquang
2025-07-15 13:29:16 +07:00
parent 55978c30fa
commit 9d5fb821c7
16 changed files with 118 additions and 37 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
import { env } from "./env";
export async function middleware(request: NextRequest) {
// Handle fuckcapcut.com domain redirect
@@ -9,7 +10,7 @@ export async function middleware(request: NextRequest) {
const path = request.nextUrl.pathname;
if (path === "/editor" && process.env.NODE_ENV === "production") {
if (path === "/editor" && env.NODE_ENV === "production") {
const homeUrl = new URL("/", request.url);
homeUrl.searchParams.set("redirect", request.url);
return NextResponse.redirect(homeUrl);