Restyle login with the Prompt logo and warm brand colors
waterfall-wiki CI and deployment / verify-and-deploy (push) Successful in 17m31s

This commit is contained in:
2026-10-27 14:34:59 +08:00
parent a33151da3c
commit 00e1b70398
4 changed files with 15 additions and 6 deletions
+2 -2
View File
@@ -3,9 +3,9 @@ import { authConfig, SESSION_COOKIE, validSession } from './lib/auth';
export function proxy(request: NextRequest) {
const path = request.nextUrl.pathname;
const responseHeaders = {'Cache-Control':'private, no-store', 'Referrer-Policy':'same-origin'};
// Only login code assets and minimal health probes are public. Images, documents,
// Only the brand mark, login code assets and minimal health probes are public. Other images, documents,
// rewrites and /_next/data are protected along with pages and API endpoints.
if (path === '/login' || path === '/api/auth/login' || path === '/api/auth/logout' || path === '/api/health' || path === '/api/ready' || path.startsWith('/_next/static/')) return NextResponse.next({headers:responseHeaders});
if (path === '/brand-mark.svg' || path === '/login' || path === '/api/auth/login' || path === '/api/auth/logout' || path === '/api/health' || path === '/api/ready' || path.startsWith('/_next/static/')) return NextResponse.next({headers:responseHeaders});
let config;
try { config = authConfig(); } catch { return NextResponse.json({error:'登录服务配置不可用'}, {status:503,headers:responseHeaders}); }
if (!config) return NextResponse.next();