-
Notifications
You must be signed in to change notification settings - Fork 2
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
로그인 인증 #40
로그인 인증 #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고 많으셨습니다!
자잘한 의견 달아두었으니 검토 해주시면 감사하겠습니다.
isLoading, | ||
}) | ||
rerender(<LoginPage />) | ||
expect(screen.getByRole('button')).not.toHaveTextContent('카카오로 시작하기') | ||
}) | ||
|
||
it('로그인 성공시 signup 라우팅', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트의 설명이 직접 구현하거나 코드의 작동 구조를 면밀히 살피지 않으면 이해하기 어려운 거 같습니다.
테스트 해야 될 대상에 대해 조금 더 알기 쉽게 작성하면 유지보수에도 좋을 거 같습니다.
(다른 사람이 작성한 거라 이해하기 힘든가 싶어서 제가 작성한 걸 보고 왔는데, 제가 작성한 것도 시간이 지나니 뭔소린지 모르겠네요ㅋㅋ 저도 고쳐놔야겠습니다)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그러게요 ㅠㅠ 어려운 일인 것 같습니다
src/features/auth/api/index.tsx
Outdated
isSignup: boolean | ||
} | ||
|
||
export const kakaoLogin = async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
함수 이름을 봤을 때는 카카오 로그인을 하는 함수인거 같은데, 구현을 보면 카카오 로그인 이후에 받아온 정보로 백엔드 서버에 로그인하는 기능인 것 같네요. 함수 이름을 조금 더 구체적으로 변경해보는건 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OAuthLogin으로 바꿔봤습니다
} | ||
}, [session.accessToken]) | ||
|
||
const signInKakao = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setIsLoading 순서가 요청이 시작될 때 true, 끝날때 false일거 같은데, 반대로 되어 있는거 같아요
그리고 성공했을때 ,실패했을때 작동하는 공통로직(setIsLoading(false))을 finally로 처리하면 반복을 줄일 수 있을거 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 좋은 것 같습니다
오류 찾아주셔서 감사합니다 :)
d9dbc5b
to
19e6c21
Compare
next auth 로그인 구현입니다
[로그인 로직]