fix(WEB): FCM 초기화 및 프록시 경로 수정

- FCMProvider를 layout.tsx에 추가 (import만 되고 사용 안 됨 → 수정)
- fcm.ts proxyBasePath: /api/proxy/v1 → /api/proxy (경로 중복 수정)
- .env.production 환경변수 이름 동기화
This commit is contained in:
2026-01-07 15:46:17 +09:00
parent c367ba4ad9
commit 0d4e6ee7ea
3 changed files with 16 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
# ============================================== # ==============================================
# API Configuration # API Configuration
# ============================================== # ==============================================
API_URL=https://api.codebridge-x.com NEXT_PUBLIC_API_URL=https://api.codebridge-x.com
# Frontend URL (for CORS) # Frontend URL (for CORS)
NEXT_PUBLIC_FRONTEND_URL=https://dev.codebridge-x.com NEXT_PUBLIC_FRONTEND_URL=https://dev.codebridge-x.com
@@ -18,5 +18,10 @@ NEXT_PUBLIC_AUTH_MODE=sanctum
# 개발용 고정 키 (주기적 갱신 예정) # 개발용 고정 키 (주기적 갱신 예정)
# 발급일: 2025-11-07 # 발급일: 2025-11-07
# 갱신 필요 시: PHP 백엔드 팀에 새 키 요청 # 갱신 필요 시: PHP 백엔드 팀에 새 키 요청
# NEXT_PUBLIC_ 접두사: 클라이언트에서 접근 가능 # ✅ 서버 전용 (클라이언트에 노출되지 않음)
NEXT_PUBLIC_API_KEY=42Jfwc6EaRQ04GNRmLR5kzJp5UudSOzGGqjmdk1a API_KEY=42Jfwc6EaRQ04GNRmLR5kzJp5UudSOzGGqjmdk1a
# ==============================================
# Google Maps API Key
# ==============================================
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=AIzaSyAS3bAzmXlhhZHgO3buFiTGzavXZ6ubYq8

View File

@@ -35,11 +35,14 @@ export default function ProtectedLayout({
// 🎨 모든 하위 페이지에 공통 레이아웃 및 Context 적용 // 🎨 모든 하위 페이지에 공통 레이아웃 및 Context 적용
// 🚨 ApiErrorProvider: Server Action 401 에러 시 자동 로그인 리다이렉트 // 🚨 ApiErrorProvider: Server Action 401 에러 시 자동 로그인 리다이렉트
// 📱 FCMProvider: Capacitor 네이티브 앱에서 FCM 푸시 알림 초기화
return ( return (
<RootProvider> <RootProvider>
<ApiErrorProvider> <ApiErrorProvider>
<AuthenticatedLayout>{children}</AuthenticatedLayout> <FCMProvider>
</ApiErrorProvider> <AuthenticatedLayout>{children}</AuthenticatedLayout>
</FCMProvider>
</ApiErrorProvider>
</RootProvider> </RootProvider>
); );
} }

View File

@@ -40,7 +40,8 @@ declare global {
const CONFIG = { const CONFIG = {
// Next.js 프록시 경로 (HttpOnly 쿠키 자동 포함) // Next.js 프록시 경로 (HttpOnly 쿠키 자동 포함)
proxyBasePath: '/api/proxy/v1', // NOTE: /api/proxy 사용 - 프록시가 자동으로 /api/v1/ 추가함
proxyBasePath: '/api/proxy',
fcmTokenKey: 'fcm_token', fcmTokenKey: 'fcm_token',
soundBasePath: '/sounds/', soundBasePath: '/sounds/',
defaultSound: 'default', defaultSound: 'default',