-
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
Implement JwtAgent, Kakao Login #15
Conversation
fun verifyKakao(userToken: String): String? | ||
fun verifyKaKao(accessToken: String): String |
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.
약간 워딩을 accessToken 말고 SNS임을 분명하게 해주면 좋을 것 같아요
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.
딱히 좋은 네이밍이 생각이 안나서 원상복구 해둘게염
|
||
private fun buildClaims(user: User): Claims { | ||
val claims = Jwts.claims() | ||
claims.setSubject(user.nickname.nickname) |
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.
아.. nickname.nickname은 좀 구린데 이거 Wrapper면 일괄적으로 value라고 하는건 어때요?
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.
좋습니다~
KakaoLoginResponse::class.java | ||
) | ||
|
||
return response.body!!.id!! |
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.
return response.body!!.id!! | |
return response.body?.id!! |
이렇게는 안되나요? 일단 id를 못받아오는경우 예외가 터질텐데 괜찮은가요?
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.
못받아올때의 에러처리를 따로 해봐야겠네요
@@ -6,5 +6,17 @@ import org.springframework.transaction.annotation.Transactional | |||
@Service | |||
@Transactional |
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.
보통 여기서 readOnly = true 하고 밑에 실제 트랜잭션 동작이 있는곳에 @transactional 붙이지 않나요? readOnly의 default가 true인것 같아서요
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.
저는 default
가 false
로 알고있는데 이건 그냥 저희끼리만 통일화하면 될 것 같아요~
return user.toDto() |
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.
val user = userRepository.findByOauthTokenPayload(payload) ?: return null | |
return user.toDto() | |
return userRepository.findByOauthTokenPayload(payload)?.toDto() |
b6f175f
to
b22eba5
Compare
26d9a31
to
6256054
Compare
추가사항 1. JwtAgent를 구현
프로젝트 전역으로 사용할 JWTAgent를 구현했습니다.
추가사항 2. KakaoOauth 구현
카카오 로그인 기능을 추가했습니다. 클라이언트로부터 AccessToken을 전달받도록 하였습니다.
++ Local DB에 대한 비밀번호가 달라 Jasypt를 다시 재민님 환경에 맞게 수정해주셔야할 것 같네요 ㅠ