diff --git a/public/images/kakao_login_medium_wide.png b/public/images/kakao_login_medium_wide.png new file mode 100644 index 0000000..c882acc Binary files /dev/null and b/public/images/kakao_login_medium_wide.png differ diff --git a/src/pages/Login/LoginPage.tsx b/src/pages/Login/LoginPage.tsx index 3e9e8b3..49a7f57 100644 --- a/src/pages/Login/LoginPage.tsx +++ b/src/pages/Login/LoginPage.tsx @@ -47,7 +47,8 @@ const LoginPage: React.FC = () => { // 카카오 로그인 버튼 클릭 시 실행될 함수 const kakaoLogin = () => { if (!window.Kakao) { - return alert("카카오 SDK가 로드되지 않았습니다."); + alert("카카오 SDK가 로드되지 않았습니다."); + return; } window.Kakao.Auth.login({ @@ -64,9 +65,7 @@ const LoginPage: React.FC = () => { body: JSON.stringify({ accessToken: authObj.access_token }), } ); - if (!res.ok) { - throw new Error(`HTTP ${res.status}`); - } + if (!res.ok) throw new Error(`HTTP ${res.status}`); // 2) 백엔드가 내려준 JSON 파싱 const resp = (await res.json()) as KakaoUserInfoResponse; @@ -86,11 +85,9 @@ const LoginPage: React.FC = () => { }, } ); - if (!hasRes.ok) { - throw new Error(`hasSignedIn 호출 실패: ${hasRes.status}`); - } + if (!hasRes.ok) throw new Error(`hasSignedIn 호출 실패: ${hasRes.status}`); - const hasJson = await hasRes.json() as { + const hasJson = (await hasRes.json()) as { success: boolean; message: string; data: { hasSignedIn: boolean }; @@ -98,10 +95,8 @@ const LoginPage: React.FC = () => { // 5) 분기 처리 if (hasJson.data.hasSignedIn) { - // 이미 가입된 회원: 홈으로 이동 window.location.href = "/"; } else { - // 신규 회원: 닉네임/응원팀 설정 단계로 이동 navigate("/signup/1"); } } catch (err) { @@ -147,64 +142,20 @@ const LoginPage: React.FC = () => {
+ {/* 카카오 로그인 버튼 */}
- 계속 진행 시{" "}
-