turn on SSO

This commit is contained in:
s871077
2026-09-21 18:42:32 +08:00
parent 137a4a2a39
commit 167eb0807d
12 changed files with 97 additions and 102 deletions
+6 -14
View File
@@ -1,18 +1,10 @@
// --- SSO DISABLED FOR CICD TEST ---
// Original: protect the whole app with role-aware auth in the edge runtime.
// import NextAuth from "next-auth";
// import { authConfig } from "@/auth.config";
//
// export const { auth: middleware } = NextAuth(authConfig);
import NextAuth from "next-auth";
import { authConfig } from "@/auth.config";
// No-op replacement. The EMPTY MATCHER below is the actual kill switch — this
// function is never invoked, and every route (including the three admin pages)
// is open.
export function middleware() {}
// Edge-runtime gate for the whole app. Uses the edge-safe config only —
// src/auth.ts pulls in node:fs via lookupRole and must never be imported here.
export const { auth: middleware } = NextAuth(authConfig);
export const config = {
// Original matcher (restore with the lines above):
// matcher: ["/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\.).*)"],
matcher: [],
matcher: ["/((?!api/auth|_next/static|_next/image|favicon.ico|.*\\.).*)"],
};
// --- END SSO DISABLED ---