From 12a757c1455acc89a26a32e0239b9d7ae8f3a06e Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 15:58:58 +0900 Subject: [PATCH 01/10] =?UTF-8?q?fix=20:=20components=ED=8F=B4=EB=8D=94=20?= =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/componenets/common/index.ts | 0 .../common/InputForm/InputForm.style.ts | 0 src/{componenets => components}/common/InputForm/InputForm.tsx | 0 .../common/SpaceClubHomeLogo/SpaceClubHomeLogo.style.ts | 0 .../common/SpaceClubHomeLogo/SpaceClubHomeLogo.tsx | 0 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/componenets/common/index.ts rename src/{componenets => components}/common/InputForm/InputForm.style.ts (100%) rename src/{componenets => components}/common/InputForm/InputForm.tsx (100%) rename src/{componenets => components}/common/SpaceClubHomeLogo/SpaceClubHomeLogo.style.ts (100%) rename src/{componenets => components}/common/SpaceClubHomeLogo/SpaceClubHomeLogo.tsx (100%) diff --git a/src/componenets/common/index.ts b/src/componenets/common/index.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/src/componenets/common/InputForm/InputForm.style.ts b/src/components/common/InputForm/InputForm.style.ts similarity index 100% rename from src/componenets/common/InputForm/InputForm.style.ts rename to src/components/common/InputForm/InputForm.style.ts diff --git a/src/componenets/common/InputForm/InputForm.tsx b/src/components/common/InputForm/InputForm.tsx similarity index 100% rename from src/componenets/common/InputForm/InputForm.tsx rename to src/components/common/InputForm/InputForm.tsx diff --git a/src/componenets/common/SpaceClubHomeLogo/SpaceClubHomeLogo.style.ts b/src/components/common/SpaceClubHomeLogo/SpaceClubHomeLogo.style.ts similarity index 100% rename from src/componenets/common/SpaceClubHomeLogo/SpaceClubHomeLogo.style.ts rename to src/components/common/SpaceClubHomeLogo/SpaceClubHomeLogo.style.ts diff --git a/src/componenets/common/SpaceClubHomeLogo/SpaceClubHomeLogo.tsx b/src/components/common/SpaceClubHomeLogo/SpaceClubHomeLogo.tsx similarity index 100% rename from src/componenets/common/SpaceClubHomeLogo/SpaceClubHomeLogo.tsx rename to src/components/common/SpaceClubHomeLogo/SpaceClubHomeLogo.tsx From e684ee1d2ba63e4d326c2c24a5169ef2682b2066 Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 16:34:44 +0900 Subject: [PATCH 02/10] =?UTF-8?q?fix=20:=20=ED=8C=8C=EC=9D=BC=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=84=EC=B9=AD=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index e3c5c112..d08b15a7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,24 +11,24 @@ "lib": ["DOM", "DOM.Iterable", "ESNext"], "jsx": "react-jsx", "allowJs": true, - "baseUrl": "./", + "baseUrl": ".", "paths": { - "@/*": ["src/*"], - "@components/*": ["src/components/*"], - "@type/*": ["src/types/*"], - "@hooks/*": ["src/hooks/*"], - "@pages/*": ["src/pages/*"], - "@styles/*": ["src/styles/*"], - "@constants/*": ["src/constants/*"], - "@assets/*": ["src/assets/*"], - "@api/*": ["src/api/*"], - "@router/*": ["src/router/*"], - "@store/*": ["src/store/*"], - "@utils/*": ["src/utils/*"] + "@/*": ["./src/*"], + "@components/*": ["./src/components/*"], + "@type/*": ["./src/types/*"], + "@hooks/*": ["./src/hooks/*"], + "@pages/*": ["./src/pages/*"], + "@styles/*": ["./src/styles/*"], + "@constants/*": ["./src/constants/*"], + "@assets/*": ["./src/assets/*"], + "@api/*": ["./src/api/*"], + "@router/*": ["./src/router/*"], + "@store/*": ["./src/store/*"], + "@utils/*": ["./src/utils/*"] }, "jsxImportSource": "@emotion/react", "allowSyntheticDefaultImports": true }, "exclude": ["node_modules"], - "include": ["src", "**/*.ts", "**/*.tsx"] + "include": ["**/*.ts", "**/*.tsx"] } From 5a659610bd54399e3cd90aa10a852dac06bc1066 Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 16:35:18 +0900 Subject: [PATCH 03/10] =?UTF-8?q?fix=20:=20components=20=EC=98=A4=ED=83=80?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/RegisterPage/RegisterPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/RegisterPage/RegisterPage.tsx b/src/pages/RegisterPage/RegisterPage.tsx index df13247f..65130e2d 100644 --- a/src/pages/RegisterPage/RegisterPage.tsx +++ b/src/pages/RegisterPage/RegisterPage.tsx @@ -1,4 +1,4 @@ -import InputForm from '@/componenets/common/InputForm/InputForm'; +import InputForm from '@components/common/InputForm/InputForm'; import { Container, SubmitBtn, Title } from './RegisterPage.style'; From a96e740e4295db90482ef23a9a56c727b48eacde Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 16:35:46 +0900 Subject: [PATCH 04/10] =?UTF-8?q?feat=20:=20axios=20=ED=81=B4=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EC=96=B8=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/axiosClient.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/apis/axiosClient.ts b/src/apis/axiosClient.ts index e69de29b..2abb3e14 100644 --- a/src/apis/axiosClient.ts +++ b/src/apis/axiosClient.ts @@ -0,0 +1,12 @@ +import axios from 'axios'; + +import { NETWORK_TIMEOUT, SPACECLUB_BASE_URL } from '@constants/api'; + +export const axiosClient = axios.create({ + baseURL: SPACECLUB_BASE_URL, + headers: { + 'Content-Type': 'application/json', + }, + withCredentials: true, + timeout: NETWORK_TIMEOUT, +}); From 5f1899dd19991dde9b1d1dcf97e71fa1629e9b92 Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 16:36:04 +0900 Subject: [PATCH 05/10] =?UTF-8?q?feat=20:=20kakaoLogin=20api=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/auth/kakaoLogin.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/apis/auth/kakaoLogin.ts diff --git a/src/apis/auth/kakaoLogin.ts b/src/apis/auth/kakaoLogin.ts new file mode 100644 index 00000000..8dfc2c54 --- /dev/null +++ b/src/apis/auth/kakaoLogin.ts @@ -0,0 +1,8 @@ +import { END_POINTS } from '@/constants/api'; + +import { axiosClient } from '../axiosClient'; + +export const kakaoLogin = async (code: string) => { + const { data } = await axiosClient.post(END_POINTS.KAKAO_LOGIN, { code }); + return data; +}; From c4c099f421f9198b33f52c40b830aa8a851117b1 Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 16:36:22 +0900 Subject: [PATCH 06/10] =?UTF-8?q?feat=20:=20api=20=EC=83=81=EC=88=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/api.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/constants/api.ts diff --git a/src/constants/api.ts b/src/constants/api.ts new file mode 100644 index 00000000..c4c01ce9 --- /dev/null +++ b/src/constants/api.ts @@ -0,0 +1,9 @@ +const SPACECLUB_BASE_URL = 'https://spaceclub.site'; + +const NETWORK_TIMEOUT = 10000; + +const END_POINTS = { + KAKAO_LOGIN: '/login/kakao', +}; + +export { SPACECLUB_BASE_URL, NETWORK_TIMEOUT, END_POINTS }; From 53959b72bcab7964ed85927aae0444872e9f0a0b Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 17:34:02 +0900 Subject: [PATCH 07/10] =?UTF-8?q?feat=20:=20User=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/user.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/types/user.ts b/src/types/user.ts index e69de29b..20ee69be 100644 --- a/src/types/user.ts +++ b/src/types/user.ts @@ -0,0 +1,5 @@ +interface User { + accessToken: string; +} + +export { User }; From ac7bde86a26920321387e644e70e740a797a16be Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 17:34:27 +0900 Subject: [PATCH 08/10] =?UTF-8?q?fix=20:=20types=20=ED=83=80=EC=9E=85?= =?UTF-8?q?=EB=B3=84=EC=B9=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index d08b15a7..e60b5496 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "paths": { "@/*": ["./src/*"], "@components/*": ["./src/components/*"], - "@type/*": ["./src/types/*"], + "@types/*": ["./src/types/*"], "@hooks/*": ["./src/hooks/*"], "@pages/*": ["./src/pages/*"], "@styles/*": ["./src/styles/*"], From 7cfd60073a28f3a095b4102d78efecd9b74002af Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 17:35:05 +0900 Subject: [PATCH 09/10] =?UTF-8?q?feat=20:=20kakaoLogin=20response=20User?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/auth/kakaoLogin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apis/auth/kakaoLogin.ts b/src/apis/auth/kakaoLogin.ts index 8dfc2c54..28325b6a 100644 --- a/src/apis/auth/kakaoLogin.ts +++ b/src/apis/auth/kakaoLogin.ts @@ -1,8 +1,10 @@ -import { END_POINTS } from '@/constants/api'; +import { User } from '@/types/user'; + +import { END_POINTS } from '@constants/api'; import { axiosClient } from '../axiosClient'; export const kakaoLogin = async (code: string) => { - const { data } = await axiosClient.post(END_POINTS.KAKAO_LOGIN, { code }); + const { data } = await axiosClient.post(END_POINTS.KAKAO_LOGIN, { code }); return data; }; From d04f8d0d709f5e70f11ced5ddea0df2b5e055b9c Mon Sep 17 00:00:00 2001 From: hyesung99 <4538asd@gmail.com> Date: Tue, 24 Oct 2023 17:35:30 +0900 Subject: [PATCH 10/10] =?UTF-8?q?feat=20:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=84=B1=EA=B3=B5=EC=8B=9C=20?= =?UTF-8?q?=ED=86=A0=ED=81=B0=20=EB=A1=9C=EC=BB=AC=EC=8A=A4=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=EC=A7=80=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/OauthRedirectPage.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pages/OauthRedirectPage.tsx b/src/pages/OauthRedirectPage.tsx index 354afe20..2099c604 100644 --- a/src/pages/OauthRedirectPage.tsx +++ b/src/pages/OauthRedirectPage.tsx @@ -1,9 +1,20 @@ +import { kakaoLogin } from '@/apis/auth/kakaoLogin'; + import { useEffect } from 'react'; const OauthRedirectPage = () => { const authCode = new URL(window.location.href).searchParams.get('code'); - useEffect(() => {}, []); + useEffect(() => { + if (!authCode) { + throw new Error('인증 코드가 없습니다.'); + } + + kakaoLogin(authCode).then(({ accessToken }) => { + localStorage.setItem('accessToken', accessToken); + window.location.href = '/'; + }); + }); return
OauthRedirectPage
; };