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

[Feat/#138] 카카오로그인 구현 완료 #145

Merged
merged 7 commits into from
Jan 20, 2025

Conversation

thisishwarang
Copy link
Collaborator

📌 관련 이슈번호


체크리스트

  • 🎋 base 브랜치를 develop 브랜치로 설정했나요?
  • 🖌️ PR 제목은 형식에 맞게 잘 작성했나요?
  • 🏗️ 빌드는 성공했나요? (yarn build)
  • 🧹 불필요한 코드는 제거했나요? e.g. console.log
  • 🙇‍♂️ 리뷰어를 지정했나요?
  • 🏷️ 라벨은 등록했나요?

✅ Key Changes

이번 PR에서 작업한 내용을 간략히 설명해주세요

  1. 카카오로그인의 전체적인 흐름을 설명해드리겠습니다.
    • LoginPage 컴포넌트에서 kakaoLoginUrl로 replace 시켜줍니다.
    • redirect URI에 의해 Redirection 컴포넌트가 호출되면서 usePostKakaoLogin.ts가 실행됩니다.
  2. 로그인이 성공하면 localStorage에 user라는 key로 userId, userName이 들어옵니다.

📢 To Reviewers


📸 스크린샷 or 실행영상

Copy link
Collaborator

@zzz-myam zzz-myam left a comment

Choose a reason for hiding this comment

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

너무 복잡하고 어려운 과정이었을텐데 정말 멋지게 해내신 것 같아요!!! 고생하셨습니다 :) 서비스의 거대한 시작을 만들어주셔서 감사합니다!

Copy link
Collaborator

@youtheyeon youtheyeon left a comment

Choose a reason for hiding this comment

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

레전드임화랑

const Redirection = () => {
const code: string =
new URL(window.location.href).searchParams.get('code') || '';
window.history.forward();
Copy link
Collaborator

Choose a reason for hiding this comment

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

goHome을 작성해준다면 forward()는 불필요할 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

로그인 성공시 사용자가 브라우저 뒤로가기를 했을 때 카카오로그인 관련 url로 되돌아 가는것을 방지하기 위함입니다!!

Copy link
Collaborator

Choose a reason for hiding this comment

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

엇 그런거군요!!! 새롭게 알아갑니다💡

};

export const isLoggedIn = () => {
return getToken() ? true : false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

어차피 true 또는 false로 반환되는 거면 삼항연산자보다 Boolean 함수가 더 적절해보입니다..!
return Boolean(getToken());은 어떠신가요 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

좋네요! 반영하겠습니다!

@thisishwarang thisishwarang merged commit 8ec8862 into develop Jan 20, 2025
3 checks passed
@thisishwarang thisishwarang deleted the feat/#138/KakaoLogin branch January 20, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] KakaoLogin 연결
3 participants