Conversation
Test Coverage Report
|
choiseoji
left a comment
There was a problem hiding this comment.
수고하셨습니다!!
너무 너무 깔끔한 코드여서 나중에 많이 참고하겠습니다 ~ 😃
| .PHONY: all build down re | ||
|
|
||
| all: build copy up | ||
|
|
||
| build: | ||
| @./gradlew clean build | ||
|
|
||
| copy: | ||
| @cp ./build/libs/backend-0.0.1-SNAPSHOT.jar ./app.jar | ||
|
|
||
| up: | ||
| @docker compose up --build -d | ||
|
|
||
| down: | ||
| @docker compose down | ||
|
|
||
| re: down up No newline at end of file |
There was a problem hiding this comment.
혹시 makefile 어디에 사용되는건가요??
There was a problem hiding this comment.
이거 빌드하고 docker compose 돌리는거 귀찮아서 만들었어요😅
| public record TokenResponse(String accessToken, String refreshToken) { | ||
|
|
||
| } |
There was a problem hiding this comment.
토큰 헤더에 안 넣고 body에 담아서 보내주는게 더 나을까요??
There was a problem hiding this comment.
앱은 어떻게 처리해야 될 지 몰라서 우선 body에 담았는데 한번 찾아볼게요!!
| public String generateSignupToken(String providerId, String provider, String email, String name) { | ||
| long now = (new Date()).getTime(); | ||
| return Jwts.builder() | ||
| .setSubject(providerId) | ||
| .claim("provider", provider) | ||
| .claim("email", email) | ||
| .claim("name", name) | ||
| .setExpiration(new Date(now + 600000)) | ||
| .signWith(key, SignatureAlgorithm.HS256) | ||
| .compact(); |
There was a problem hiding this comment.
이건 그냥 저희 signup api 를 호출하기 위한 토큰인거죠 ??
There was a problem hiding this comment.
맞아요 추가 정보 받을 때 사용할 임시 토큰이용
| TokenResponse response = authService.completeSignup(signupRequest); | ||
|
|
||
| return ResponseEntity.ok(new CommonResponse<>("회원가입이 완료되었습니다.", response)); | ||
| } |
There was a problem hiding this comment.
accessToken 만료 되었을 때 재발급하는 api 가 없어서 이것만 있으면 될거 같아요!!
accessToken 발급할때 refeshToken도 새로 발급하는 RTR 방식 사용해도 좋을거 같아요!!
There was a problem hiding this comment.
재발급 api 까먹,, RTR 방식 찾아보고 수정할게요!!
| public record SignupResponse(boolean isNewUser, String signupToken, String email, String name, | ||
| String provider, TokenResponse tokens) { | ||
|
|
||
| public static SignupResponse forExistingUser(TokenResponse tokens) { | ||
| //기존 회원은 토큰만 리턴 | ||
| return new SignupResponse(false, null, null, null, null, tokens); | ||
| } | ||
|
|
||
| public static SignupResponse forNewUser(String signupToken, String email, String name, | ||
| String provider) { | ||
| //신규 회원은 회원가입을 위한 정보와 임시 토큰 리턴 | ||
| return new SignupResponse(true, signupToken, email, name, provider, null); | ||
| } | ||
| } |
There was a problem hiding this comment.
null이 많긴 하지만 좋은거 같아요!!
null 없이 하려면 인터페이스 만들어서 forExistingUser 용 response, forNewUser 용 response 를 따로 구현하는 방법도 추천받았는데, 지금 방식이 더 나은 것 같아요
| private LocalDateTime createdAt; | ||
|
|
||
| private LocalDateTime updatedAt; | ||
|
|
||
| private LocalDateTime deletedAt; |
There was a problem hiding this comment.
아 이거 baseEntity 만들어서 extends 하면 되는거라서
제가 엔티티 만들면서 추가해두겠습니다!!
|
|
||
| import run.backend.domain.member.enums.Gender; | ||
|
|
||
| public record SignupRequest(String signupToken, String nickname, Gender gender, int age, String profileImage) { |
There was a problem hiding this comment.
SignupResponse에 이미지 관련 필드는 없는거 같은데 profileImage는 어디서 받아오는 건가요??
만약, 유저가 직접 업로드하는 거라면 파일로 받아서 처리해야 될거 같아요!
There was a problem hiding this comment.
이거 구글에서 제공해주는 사용자 프로필 생각했는데 그거 말고 저희 추가 정보 받는 곳에서 파일로 받도록 수정할게요!
Test Coverage Report
|
|
|
||
| @PostMapping("/refresh") | ||
| public ResponseEntity<CommonResponse<TokenResponse>> refresh( | ||
| @RequestHeader("Authorization") String authorizationHeader) { |
There was a problem hiding this comment.
오 대박 이렇게 가지고 올 수 있는거 처음 알았어요
Test Coverage Report
|
✨ 연관된 이슈
📝 작업 내용 (주요 변경 사항)
💬 리뷰 요구사항
저희 테스트 커버리지가 너무 높은 것 같은듯,, 서지님 한번 해보시고 같이 조정해봐요~