Skip to content
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

카카오 로그인 테스트 (help wanted🐣) #6

Closed
wants to merge 3 commits into from
Closed

Conversation

NamJwong
Copy link
Member

@NamJwong NamJwong commented May 7, 2022

⛓ Related Issues

📋 작업 내용

  1. loginTest 페이지를 만들었고 페이지 내의 로그인 버튼을 누르면 카카오 서버에 인증 코드 요청을 합니다
window.location.href = `https://kauth.kakao.com/oauth/authorize?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}&response_type=code`
  1. redirect uri인 auth/kakao/callback 페이지를 만들었고 useEffect에서 로그인 get 요청을 합니다
useEffect(() => {
    const authenticationCode = new URL(window.location.href).searchParams.get('code') ?? '';
    (async () => {
      await axios
        .get(`${BASE_URL}/auth/kakao/callback?code=${authenticationCode}`)
        .catch((error: AxiosError) => console.log('무슨 에러 나는거얏!', error));
    })();
  }, []);
  1. 아래와 같은 에러가 납니다(CORS+404)

image

📌 PR Point

CORS 에러가 나는데 어진이랑 이래저래 다 해봐도 해결이 안돼서 혹시 클라 코드에 문제가 있는건가 싶어서 한번 봐주시면 좋겠습니다ㅜ

지금 서버가 아직 DB 구축 중이라 완벽하게 가입이 이루어지진 않지만 인증 자체는 되도록 구현된 상태라 클라에서 테스트 해볼 수 있습니다
만약 정상적으로 작동한다면 아래와 같은 에러 형태에 user code 뒤에 숫자가 있을 것이라고 하네요
image
그런데 위에서 보셨다시피 지금 404 에러가 나긴 나는데 CORS 에러 때문에 잡히지가 않아서 내용을 뜯어볼 수가 없고,, CORS 에러 왜 날까요ㅠ
image

@NamJwong NamJwong added the help wanted 🐣 Extra attention is needed label May 7, 2022
@NamJwong NamJwong self-assigned this May 7, 2022
@NamJwong
Copy link
Member Author

NamJwong commented May 7, 2022

@ozzing @vvhustle 상황 공유되면 좋을 것 같아서 태그합니다!

Copy link
Member

@SeojinSeojin SeojinSeojin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ozzing
Copy link

ozzing commented May 7, 2022

제가 마저 다 구현해보고 맞춰보면 좋을 것 같아요! 수고하셨습니당😭👍🏻

@NamJwong
Copy link
Member Author

NamJwong commented May 8, 2022

그러면 테스트니까 PR 닫고 merge는 안하고 이 브랜치에 이어서 로그인 작업 마무리 해서 다시 PR 올리겠습니다!

@NamJwong NamJwong closed this May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🐣 Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

카카오톡 소셜 로그인 구현하기
3 participants