Open
Conversation
PFCJeong
reviewed
Sep 26, 2023
| binderFactory: WebDataBinderFactory?, | ||
| ): User { | ||
| TODO() | ||
| val token = webRequest.getHeader("Authorization").toString().substringAfter("Bearer ") |
| override fun signIn(username: String, password: String): User { | ||
| TODO("Not yet implemented") | ||
| val userEntity = userRepository.findByUsername(username) | ||
| if (userEntity is UserEntity) { |
Member
There was a problem hiding this comment.
if (userEntity != null)로 하면 될 것 같습니다. 타입 체크한 이유가 따로 있나요?
Author
There was a problem hiding this comment.
타입체크 용도보다 is구문 자체가 먼가 더 직관적인거 같다는 느낌이 들어서 그랬던 것 같습니다! ㅋㅋㅋ
여러개의 타입이 가능한 것이 아니면 널 체크가 더 맞겠네요 ㅎㅎ 감사합니다
| if (userEntity is UserEntity) { | ||
| if (userEntity.password != password) throw SignInInvalidPasswordException() | ||
| else return User(username= userEntity.username, image = userEntity.image) | ||
| } else throw SignInUserNotFoundException() |
Member
There was a problem hiding this comment.
전체적인 흐름이
- 유저 아이디로 유저 정보 체크
- 유저 비밀번호 체크
- 유저 정보 반환
인데요.
로직과 코드의 순서가 다르면 가독성을 해칠 수 있습니다.
PFCJeong
approved these changes
Sep 26, 2023
1a8e813 to
f420cff
Compare
633df04 to
66e14db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
기존 커밋을 지워버려서 다시 올립니다ㅜ