회원가입 진행중

This commit is contained in:
2026-01-30 16:16:54 +09:00
parent d18ed72493
commit debf24e4cc
49 changed files with 9490 additions and 1 deletions

33
middleware.ts Normal file
View File

@@ -0,0 +1,33 @@
import { type NextRequest } from "next/server";
import { updateSession } from "@/utils/supabase/middleware";
/**
* [Next.js 미들웨어 진입점]
*
* 웹사이트의 모든 요청은 이 함수를 가장 먼저 거쳐갑니다.
* 여기서 로그인 여부를 체크하거나 세션을 갱신합니다.
*/
export async function middleware(request: NextRequest) {
// 방금 만든 updateSession 함수를 호출하여 쿠키/세션을 관리합니다.
return await updateSession(request);
}
/**
* [미들웨어 설정]
*
* 미들웨어가 '어떤 경로'에서 실행될지, '어떤 경로는 무시할지' 정하는 규칙입니다.
*/
export const config = {
matcher: [
/*
* 아래 정규식(Regex)은 다음 파일들을 제외(exclude)하고 모든 요청을 미들웨어로 보냅니다:
* - _next/static (이미 빌드된 정적 파일들)
* - _next/image (이미지 최적화 API)
* - favicon.ico (파비콘 아이콘)
* - .svg, .png, .jpg 등 이미지 파일들
*
* 즉, html 페이지 요청이나 데이터 요청에만 미들웨어가 작동하도록 하여 성능을 최적화합니다.
*/
"/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",
],
};