-
Notifications
You must be signed in to change notification settings - Fork 1
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] 구매자 로그인 #64
The head ref may contain hidden characters: "feature/7_kimhyun5u_\uAD6C\uB9E4\uC790_\uB85C\uADF8\uC778"
[feat] 구매자 로그인 #64
Conversation
- CustomerFixture 의 기능과 목적을 설명하는 주석 명시
- 로그인 성공, 로그인 실패 - 이메일 없음, 패스워드 불일치 추가
- SignInCustomerService.signIn 구현 - 이메일 없음과 패스워드 불일치를 같이 처리하면서 보안 강화
- 구매자 로그인에 필요한 email, password 필드 추가
- 구매자 로그인 시 구매자 검색에 필요한 findByEmail 구현
- 구매자 로그인 실패 시 인증 오류 구현
- CustomerControllerTest.testSignInCustomer: 구매자 로그인 테스트 성공 - CustomerControllerTest.testSignInCustomerFail: 구매자 로그인 테스트 실패
- 구매자 로그인 성공 시 OK 반환 - 구매자 로그인 실패 시 BadRequest 반환
- 로그인 실패 시 ErrorCode 추가
- 구매자 로그인을 위한 SignInCustomerRequest 이메일, 패스워드 필드 추가
…매자_로그인 # Conflicts: # src/main/java/camp/woowak/lab/web/api/CustomerController.java # src/test/java/camp/woowak/lab/web/api/customer/CustomerApiControllerTest.java
- 구매자 로그인 실패 시 예외 추가
- 로그인 실패 시 에러코드 구현
- 이메일이 존재하지 않는 지 비밀번호가 존재하지 않는 지 서버 시점에서 명확히 구분할 수 있도록 수정
- UnauthorizedException(ErroCode, String) 생성자 추가
- 로그인 된 구매자의 UUID 를 전달하도록 수정
- CustomerApiControllerTest.testLoginCustomer: 로그인 성공 시 테스트 - CustomerApiControllerTest.testLoginFail: 로그인 실패 시 테스트
- 로그인 인증 후 session 에 LoginCustomer 저장
- 로그인 실패 시 발생하는 예외 처리
- CustomerApiController.login 반환값 추가
- 기존 400 로 관리하던 Status 를 HttpStatus 를 이용해 관리하도록 수정
- 비밀번호가 일치하지 않을 때 예외 던지도록 수정
- 반환값을 Optional 로 랩핑
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/main/java/camp/woowak/lab/customer/exception/CustomerErrorCode.java
Outdated
Show resolved
Hide resolved
src/main/java/camp/woowak/lab/web/api/customer/CustomerExceptionHandler.java
Show resolved
Hide resolved
- ProblemDetail 를 생성하는 코드가 겹쳐서 private 메소드로 추출
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.
좋습니다. 저희 예외처리가 책임이 분산되어 있다는 느낌을 받고 있는데 추후 Discussion에서 논의하도록 하겠습니다.
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.
ExceptionHandler에서 메서드 추출해서 공통처리해준것 좋아보입니다!
리뷰 감사합니다 :3 |
💡 다음 이슈를 해결했어요.
Issue Link - #7
💡 이슈를 처리하면서 추가된 코드가 있어요.
💡 이런 고민을 했어요.
✅ 셀프 체크리스트