From ba2ada64c2ba785f54a315f911225d2c0d6c5586 Mon Sep 17 00:00:00 2001 From: yoonyesol Date: Sun, 8 Dec 2024 23:05:04 +0900 Subject: [PATCH] =?UTF-8?q?Formatting:=20#291=20=EC=86=8C=EC=85=9C?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EA=B3=B5=EA=B8=89=EC=97=85?= =?UTF-8?q?=EC=B2=B4=20=EB=B3=80=EC=88=98=EB=AA=85=20=EC=86=8C=EB=AC=B8?= =?UTF-8?q?=EC=9E=90=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/services/authServiceHandler.ts | 8 ++++---- src/routes/MainRouter.tsx | 4 ++-- src/types/UserType.tsx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mocks/services/authServiceHandler.ts b/src/mocks/services/authServiceHandler.ts index 4096e34f..6644a7c7 100644 --- a/src/mocks/services/authServiceHandler.ts +++ b/src/mocks/services/authServiceHandler.ts @@ -88,14 +88,14 @@ const authServiceHandler = [ const { provider } = params as { provider: SocialLoginProvider }; const { code } = (await request.json()) as { code: string }; - const validProviders = ['KAKAO', 'GOOGLE']; + const validProviders = ['kakao', 'google']; if (!validProviders.includes(provider)) { return HttpResponse.json({ message: '지원하지 않는 Provider입니다.' }, { status: 400 }); } // 공급업체별 설정 정보 const providerConfigs = { - KAKAO: { + kakao: { tokenUrl: `https://kauth.kakao.com/oauth/token`, userInfoUrl: 'https://kapi.kakao.com/v2/user/me', accessTokenParams: { @@ -107,7 +107,7 @@ const authServiceHandler = [ accessTokenKey: 'access_token', headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' }, }, - GOOGLE: { + google: { tokenUrl: `https://oauth2.googleapis.com/token`, userInfoUrl: 'https://www.googleapis.com/userinfo/v2/me', accessTokenParams: { @@ -165,7 +165,7 @@ const authServiceHandler = [ } // 이메일 기반으로 사용자 검색 또는 회원가입 - const email = provider === 'KAKAO' ? userInfo.kakao_account.email : userInfo.email; + const email = provider === 'kakao' ? userInfo.kakao_account.email : userInfo.email; if (!email) return HttpResponse.json({ message: '이메일 정보를 가져올 수 없습니다.' }, { status: 400 }); const foundUser = USER_DUMMY.find((user) => user.email === email); diff --git a/src/routes/MainRouter.tsx b/src/routes/MainRouter.tsx index 8d14f754..17fb71e7 100644 --- a/src/routes/MainRouter.tsx +++ b/src/routes/MainRouter.tsx @@ -46,8 +46,8 @@ export default function MainRouter() { children: [ { path: 'signup', element: }, { path: 'signin', element: }, - { path: 'auth/kakao/callback', element: }, - { path: 'auth/google/callback', element: }, + { path: 'auth/kakao/callback', element: }, + { path: 'auth/google/callback', element: }, { path: 'search/id', element: }, { path: 'search/password', element: }, ], diff --git a/src/types/UserType.tsx b/src/types/UserType.tsx index 15f875c5..eee72db0 100644 --- a/src/types/UserType.tsx +++ b/src/types/UserType.tsx @@ -1,6 +1,6 @@ import type { Role } from '@/types/RoleType'; -export type SocialLoginProvider = 'KAKAO' | 'GOOGLE'; +export type SocialLoginProvider = 'kakao' | 'google'; export type User = { userId: number;