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: 로그인 기능 구현 #165

Merged
merged 13 commits into from
Nov 19, 2023
Merged

feat: 로그인 기능 구현 #165

merged 13 commits into from
Nov 19, 2023

Conversation

bbearcookie
Copy link
Member

🧩 이슈 번호

✅ 작업 사항

  • 로그인 기능을 구현했어요.
    • 실행 흐름: /join -> 카카오 로그인 페이지 -> /login/kakao/oauth -> 백엔드 API 검증 요청 후 로그인 or 회원가입 분기 처리 -> 로그인이면 / 로 이동. 회원가입이면 /guide 로 이동.
  • 로그인을 위한 모킹 API를 구현했어요.

👩‍💻 공유 포인트 및 논의 사항

GOMCAM.20231117_2302460131.mp4

.env 파일에 들어가야 할 내용이 몇 가지 추가되었는데, 이걸 어떻게 공유할까요?
BE 팀에서는 서브 모듈을 사용하시는 것 같던데, 비슷하게 구성해볼까요?

@bbearcookie bbearcookie added ☁️ FE 프론트 레포지토리에서의 작업 ✨ feature 새로운 기능에 대한 작업 labels Nov 17, 2023
@bbearcookie bbearcookie self-assigned this Nov 17, 2023
Copy link

netlify bot commented Nov 17, 2023

Deploy Preview for moabam-storybook ready!

Name Link
🔨 Latest commit bd1c3de
🔍 Latest deploy log https://app.netlify.com/sites/moabam-storybook/deploys/655a255c8b9efc0008ed4fd7
😎 Deploy Preview https://deploy-preview-165--moabam-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@bbearcookie bbearcookie added this to the 3차 스프린트 milestone Nov 17, 2023
Comment on lines +17 to +26
useEffect(() => {
mutate(
{ code: code ?? '' },
{
onSuccess: ({ signUp }) => {
moveTo(signUp ? 'guide' : 'start');
}
}
);
}, []);
Copy link
Member Author

Choose a reason for hiding this comment

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

요 부분이 조금 마음에 걸리는데요!

이 페이지가 렌더링되면 자동으로 로그인 검증 요청 API를 쏴야하는데
로그인 검증 요청 API의 HTTP 메소드가 POST 이다보니 useQuery 를 사용하는건 적절하지 않다고 판단해서 useEffect 에서 호출했는데 어떻게 생각하시나요!? 혹은 더 좋은 방법이 있을까요?

(개발 모드에서는 두 번 호출되기 때문에 API 호출도 두 번 발생하긴 합니다..)

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 같은 생각입니당 POST요청이기에 mutate가 맞다고 생각돼요! 도움을 드리고 싶지만 저도 useEffect 방법밖에 생각이 나지않네요 ㅠㅠ

Comment on lines +17 to +26
useEffect(() => {
mutate(
{ code: code ?? '' },
{
onSuccess: ({ signUp }) => {
moveTo(signUp ? 'guide' : 'start');
}
}
);
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

저도 같은 생각입니당 POST요청이기에 mutate가 맞다고 생각돼요! 도움을 드리고 싶지만 저도 useEffect 방법밖에 생각이 나지않네요 ㅠㅠ

@nayeon-hub
Copy link
Contributor

nayeon-hub commented Nov 18, 2023

저희도 BE에서 사용하신 방법을 비슷하게 써보면 좋을 것 같아용!

@bbearcookie bbearcookie merged commit 9c0a51a into main Nov 19, 2023
@bbearcookie bbearcookie deleted the feat/#141/signin branch November 19, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☁️ FE 프론트 레포지토리에서의 작업 ✨ feature 새로운 기능에 대한 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

로그인 기능 구현
2 participants