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

카카오 로그인 기능 구현 #1

Merged
merged 1 commit into from
May 1, 2024
Merged

카카오 로그인 기능 구현 #1

merged 1 commit into from
May 1, 2024

Conversation

Arooming
Copy link
Owner

@Arooming Arooming commented Jul 2, 2023

💥기능 구현

  • 소셜 로그인 PreTask
    • client ID, redirect url 활용하여 URL 생성 (→ 카카오 이미지 클릭 시, 해당 주소로 이동)
      • prompt=login : 기존 사용자 인증 여부와 상관없이, 로그인 화면 출력함
        • 해당 옵션이 없으면 기존 사용자는 인증하지 않고 바로 인가코드 발급됨 (이번엔 테스트를 위해서 설정해줬슴당)
      • 인가코드 활용하여 access_token, refresh_token, 유저 정보 받아오기 성공

대략 요런 느낌으로 구현했습니당!

image

image

image



👀 코멘트

코드 리뷰를,,,, 망각하고,, main에서 작업한 바람에 pr용 브랜치를 따로 팠습ㄴㅣ다,,,(지송)
코드 영역 늘려서 봐주심 됩니다 ㅎㅎ!!!

보기 불편하겠지만, 가볍게 보시구 편하게 의견 주심 감사하겠슴돠..!

브랜치 파기를 잊지말자!



📖 reference

Copy link

@gunom gunom left a comment

Choose a reason for hiding this comment

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

큰 문제 없이 잘 동작할 거 같아요! 실제로는 함수 분리도 신경쓰기!

@@ -1,3 +1,5 @@
// KakaoCallback.tsx

import { useEffect } from "react";
import axios from "axios";
import { CLIENT_ID, REDIRECT_URI } from "../constant/OAuth";
Copy link

Choose a reason for hiding this comment

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

개인 정보를 받아오는 api는 보통 서버 단에서 처리합니다. 저희는 kakao sso token만 넘기면 가능!

@Arooming Arooming merged commit 1aefb2c into main May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants