mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
cleanup
This commit is contained in:
@@ -3,6 +3,8 @@ import type { NextRequest } from "next/server";
|
||||
import { env } from "./env";
|
||||
|
||||
export async function middleware(request: NextRequest) {
|
||||
const protectedPaths = ["/editor", "/projects"];
|
||||
|
||||
// Handle fuckcapcut.com domain redirect
|
||||
if (request.headers.get("host") === "fuckcapcut.com") {
|
||||
return NextResponse.redirect("https://opencut.app/why-not-capcut", 301);
|
||||
@@ -10,7 +12,7 @@ export async function middleware(request: NextRequest) {
|
||||
|
||||
const path = request.nextUrl.pathname;
|
||||
|
||||
if (path.startsWith("/editor") && env.NODE_ENV === "production") {
|
||||
if (protectedPaths.includes(path) && env.NODE_ENV === "production") {
|
||||
const homeUrl = new URL("/", request.url);
|
||||
homeUrl.searchParams.set("redirect", request.url);
|
||||
return NextResponse.redirect(homeUrl);
|
||||
|
||||
Reference in New Issue
Block a user