CHORE(merge): merge from develop
Some checks failed
Build Docker Image / build-and-push (push) Has been cancelled
CI / lint-and-build (push) Has been cancelled

- Initial setup and all features from develop branch
- Includes: auth, deploy, docker, style fixes
- K3S deployment configuration
This commit is contained in:
2026-01-06 17:29:16 +09:00
parent b4ce36ba3b
commit f78454c2a1
159 changed files with 18365 additions and 774 deletions

41
nextjs/proxy.ts Normal file
View File

@@ -0,0 +1,41 @@
import { NextRequest, NextResponse } from "next/server";
export async function proxy(req: NextRequest) {
const { pathname } = req.nextUrl;
// 로그인/회원가입 페이지는 세션 쿠키가 있으면 홈으로 리다이렉트
if (pathname.startsWith("/login") || pathname.startsWith("/signup")) {
const sessionToken = req.cookies.get("authjs.session-token") ||
req.cookies.get("__Secure-authjs.session-token");
if (sessionToken) {
return NextResponse.redirect(new URL("/", req.url));
}
return NextResponse.next();
}
// 보호된 경로 설정 - 공지사항 작성, 갤러리 작성 페이지
if (pathname.startsWith("/announcements/create") || pathname.startsWith("/gallery/write")) {
const sessionToken = req.cookies.get("authjs.session-token") ||
req.cookies.get("__Secure-authjs.session-token");
if (!sessionToken) {
return NextResponse.redirect(new URL("/login", req.url));
}
}
return NextResponse.next();
}
export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - api (API routes)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
*/
"/((?!api|_next/static|_next/image|favicon.ico|.*\\..*|icon.png).*)",
],
};