From 9390eaa6ebf10899480575307c218c1cc26a4fad Mon Sep 17 00:00:00 2001 From: Citali Date: Sun, 6 Jul 2025 10:58:47 +0200 Subject: [PATCH] Disable login temporarily --- src/_middleware.ts | 24 ++++++++++++++++++++++++ src/components/global/Header.tsx | 8 ++++---- src/middleware.ts | 24 ------------------------ 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 src/_middleware.ts delete mode 100644 src/middleware.ts diff --git a/src/_middleware.ts b/src/_middleware.ts new file mode 100644 index 0000000..5f1e588 --- /dev/null +++ b/src/_middleware.ts @@ -0,0 +1,24 @@ +// import { auth } from "@/auth" +// import type { NextRequest } from "next/server" +// import { NextResponse } from "next/server" + +// export async function middleware(request: NextRequest) { +// const session = await auth() + +// const isProtectedPath = +// !request.nextUrl.pathname.startsWith("/api/auth") && +// !request.nextUrl.pathname.startsWith("/_next") && +// !request.nextUrl.pathname.startsWith("/favicon") && +// !request.nextUrl.pathname.startsWith("/assets") + +// if (isProtectedPath && !session) { +// const signInUrl = new URL("/api/auth/signin", request.url) +// return NextResponse.redirect(signInUrl) +// } + +// return NextResponse.next() +// } + +// export const config = { +// matcher: ["/((?!api/auth|_next/static|_next/image|favicon.ico).*)"], +// } \ No newline at end of file diff --git a/src/components/global/Header.tsx b/src/components/global/Header.tsx index 3e2eaeb..f8c373d 100644 --- a/src/components/global/Header.tsx +++ b/src/components/global/Header.tsx @@ -1,16 +1,16 @@ -import { auth } from "@/auth"; -import { SignInOutButton } from "../auth/SignInOutButton"; +// import { auth } from "@/auth"; +// import { SignInOutButton } from "../auth/SignInOutButton"; import ModeToggle from "./ModeToggle"; import TopNav from "./TopNav"; export default async function Header() { - const session = await auth() + // const session = await auth() return (
- + {/* */}
diff --git a/src/middleware.ts b/src/middleware.ts deleted file mode 100644 index ef99640..0000000 --- a/src/middleware.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { auth } from "@/auth" -import type { NextRequest } from "next/server" -import { NextResponse } from "next/server" - -export async function middleware(request: NextRequest) { - const session = await auth() - - const isProtectedPath = - !request.nextUrl.pathname.startsWith("/api/auth") && - !request.nextUrl.pathname.startsWith("/_next") && - !request.nextUrl.pathname.startsWith("/favicon") && - !request.nextUrl.pathname.startsWith("/assets") - - if (isProtectedPath && !session) { - const signInUrl = new URL("/api/auth/signin", request.url) - return NextResponse.redirect(signInUrl) - } - - return NextResponse.next() -} - -export const config = { - matcher: ["/((?!api/auth|_next/static|_next/image|favicon.ico).*)"], -} \ No newline at end of file