Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 개발 환경에서 사용할 API 기본 URL (프록시 사용)
VITE_API_BASE_URL=
6 changes: 5 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# 프로덕션 환경에서 사용할 API 기본 URL
VITE_API_BASE_URL=https://zerojae175-dev.store
# 현재 CORS 문제로 인해 빈 값으로 설정 (상대 경로 사용)
VITE_API_BASE_URL=

# 백엔드 CORS 설정이 완료되면 아래 주석을 해제하고 위 라인을 주석 처리하세요
# VITE_API_BASE_URL=https://zerojae175-dev.store
6 changes: 1 addition & 5 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
Expand Down
8 changes: 3 additions & 5 deletions services/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ const parseJsonResponse = async (response: Response): Promise<any> => {
};

// 개발 환경에서는 프록시 사용, 배포 환경에서는 실제 API URL 사용
const API_BASE_URL =
import.meta.env.VITE_API_BASE_URL ||
(import.meta.env.DEV ? "" : "https://zerojae175-dev.store");
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "";

export const authService = {
signup: async (userData: SignupData): Promise<SignupResponse> => {
Expand All @@ -73,7 +71,7 @@ export const authService = {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include", // CORS 요청에 credentials 포함
mode: "cors", // 명시적으로 CORS 모드 설정
body: JSON.stringify(userData),
});

Expand Down Expand Up @@ -124,7 +122,7 @@ export const authService = {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
mode: "cors", // 명시적으로 CORS 모드 설정
body: JSON.stringify(credentials),
});

Expand Down