-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 회원가입 API, 카카오 로그인 연동 #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
2c9b208
c817393
71108b9
c7071eb
8c08ada
c7c02c7
2bfa209
ecfea4e
fbe0f16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| NEXT_PUBLIC_API_BASE_URL="https://api.8aladin.shop" | ||
| NEXT_PUBLIC_API_BASE_URL=https://api.8aladin.shop |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,12 +14,13 @@ | |
| "build-storybook": "storybook build" | ||
| }, | ||
| "dependencies": { | ||
| "antd": "^5.27.4", | ||
| "antd": "^6.0.1", | ||
| "axios": "^1.13.2", | ||
| "clsx": "^2.1.1", | ||
| "next": "^15.5.7", | ||
| "react": "^19.1.2", | ||
| "react-dom": "^19.1.2" | ||
| "react-dom": "^19.1.2", | ||
| "recoil": "^0.7.7" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chain🌐 Web query:
💡 Result: Short answer: Recoil is not reliably compatible with React 19 (as of late 2024–2025). The Recoil repo was archived on Jan 1, 2025 and there are open issues/reports of runtime errors when running Recoil on React 19; most community guidance is to stay on React 18 or migrate to a maintained state library (Zustand/Redux/Jotai, etc.). [1][2][3] Sources:
🌐 Web query:
💡 Result: Short answer: Recoil (facebookexperimental/Recoil) was archived and is no longer actively maintained — the repository was marked read-only on Jan 1, 2025. [1][2] Sources:
🌐 Web query:
💡 Result: Short answer: Yes — both Jotai and Zustand were actively developed in 2025.
Sources: Switch from Recoil to an actively maintained state management library Recoil was archived and discontinued by Meta on January 1, 2025, and is no longer actively maintained. It has documented compatibility issues with React 19 that cause runtime errors. For long-term project maintenance, consider migrating to actively developed alternatives like Zustand or Jotai. |
||
| }, | ||
| "devDependencies": { | ||
| "@chromatic-com/storybook": "^4.1.1", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,32 @@ const axiosInstance = axios.create({ | |
| headers: { | ||
| "Content-Type": "application/json", | ||
| }, | ||
| withCredentials: true, // 쿠키를 포함하여 요청 전송 | ||
| }); | ||
|
|
||
| // 쿠키에서 accessToken을 읽어오는 유틸리티 함수 | ||
| function getCookie(name: string): string | null { | ||
| if (typeof document === "undefined") return null; | ||
|
|
||
| const value = `; ${document.cookie}`; | ||
| const parts = value.split(`; ${name}=`); | ||
|
|
||
| if (parts.length === 2) { | ||
| return parts.pop()?.split(";").shift() || null; | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| // 요청 인터셉터 | ||
| axiosInstance.interceptors.request.use( | ||
| config => { | ||
| // 필요시 토큰 추가 등의 로직 | ||
| // 쿠키에서 accessToken을 읽어서 Authorization 헤더에 추가 | ||
| const accessToken = getCookie("accessToken"); | ||
|
|
||
| if (accessToken && config.headers) { | ||
| config.headers.Authorization = `Bearer ${accessToken}`; | ||
| } | ||
|
|
||
| return config; | ||
| }, | ||
| error => { | ||
|
|
@@ -24,7 +44,28 @@ axiosInstance.interceptors.response.use( | |
| return response; | ||
| }, | ||
| error => { | ||
| // 에러 처리 로직 | ||
| // 401 에러 처리 | ||
| if (error.response?.status === 401) { | ||
| // 인증이 필요한 경우에만 로그인 페이지로 리다이렉트 | ||
| // 채팅방 생성 API는 permitAll이므로 여기서 리다이렉트하지 않음 | ||
| console.error("인증 오류:", error.response?.data); | ||
|
|
||
| // 로그인이 필요한 API에 대해서만 리다이렉트 | ||
| // 현재 요청 URL이 인증이 필요하지 않은 엔드포인트인지 확인 | ||
| const url = error.config?.url || ""; | ||
| const isPublicEndpoint = | ||
| url.includes("/api/v1/chatrooms") || | ||
| url.includes("/api/v1/products") || | ||
| url.includes("/api/v1/images"); | ||
|
Comment on lines
+56
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| // 공개 엔드포인트가 아니고, 로그인 페이지가 아닌 경우에만 리다이렉트 | ||
| if (!isPublicEndpoint && typeof window !== "undefined" && !window.location.pathname.startsWith("/login")) { | ||
| // 로그인 페이지로 리다이렉트할 때 현재 URL을 저장 | ||
| const currentUrl = window.location.pathname + window.location.search; | ||
| window.location.href = `/login?redirect=${encodeURIComponent(currentUrl)}`; | ||
| } | ||
| } | ||
|
|
||
| return Promise.reject(error); | ||
| } | ||
| ); | ||
|
|
@@ -33,3 +74,5 @@ export default axiosInstance; | |
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||||
| import axiosInstance from "./axiosInstance"; | ||||||||||
|
|
||||||||||
| // 회원가입 요청 타입 | ||||||||||
| export interface SignupRequest { | ||||||||||
| name: string; | ||||||||||
| email: string; | ||||||||||
| password: string; | ||||||||||
| mobileNumber: string; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // 회원가입 응답 타입 | ||||||||||
| export interface SignupResponse { | ||||||||||
| memberId: number; | ||||||||||
| name: string; | ||||||||||
| email: string; | ||||||||||
| message: string; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| // 회원가입 API | ||||||||||
| export async function signup( | ||||||||||
| signupData: SignupRequest | ||||||||||
| ): Promise<SignupResponse> { | ||||||||||
| const response = await axiosInstance.post<SignupResponse>( | ||||||||||
| "/api/v1/members/signup", | ||||||||||
| signupData | ||||||||||
| ); | ||||||||||
| console.log("요청 URL:", response.config.url); | ||||||||||
| console.log("응답 데이터:", response.data); | ||||||||||
| console.log("요청 데이터:", signupData); | ||||||||||
|
Comment on lines
+27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Comment on lines
+27
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 프로덕션 배포 전에 console.log 문을 제거하세요. 디버깅용 console.log 문은 개발 중에는 유용하지만, 프로덕션 코드에는 포함되지 않아야 합니다. - console.log("요청 URL:", response.config.url);
- console.log("응답 데이터:", response.data);
- console.log("요청 데이터:", signupData);
return response.data;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| return response.data; | ||||||||||
| } | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
antd v6 migration guide breaking changes💡 Result:
Key breaking changes & migration notes for Ant Design v6 (summary):
Recommended migration steps
Sources:
[1] Ant Design v6 migration doc (official). (ant.design)
[2] Ant Design v6 release announcement / GitHub issue. (github.com)
[3] Ant Design X / blog notes on v6 (styling, IE drop, semantic changes). (github.com)
If you want, I can open the official v6 migration page and extract the exact migration checklist and component-level breaking changes for the components you use — tell me which components you rely on.
Citations:
🏁 Script executed:
Repository: 8aladin-Project/frontend
Length of output: 95
🏁 Script executed:
Repository: 8aladin-Project/frontend
Length of output: 15473
antd v6 メジャーバージョンアップグレード対応確認必須
antdをv5からv6にアップグレードする場合、複数の破壊的変更に対応が必要です。
Spaceコンポーネントのdirection→orientation変更を含む、APIの互換性がなくなる変更があります。既に一部ファイル(ItemList.tsx、ProfileSection.tsx)ではv6 APIへの移行が確認できますが、edit/page.tsxなどではまだ旧APIが使用されています。さらに、antd v6ではスタイリングシステムがCSS変数ベースに変更され、React 18以上が必須となるため、公式マイグレーションガイドに従い、すべてのコンポーネント使用状況とカスタムスタイル、テーマをv6互換に更新してください。🤖 Prompt for AI Agents