Skip to content
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: 로그인 기능 고도화 #12

Merged
merged 13 commits into from
Jul 25, 2024
Merged

Conversation

songyi00
Copy link
Member

@songyi00 songyi00 commented Jul 24, 2024

작업 개요

로그인 기능 고도화, 리팩터링

작업 사항

  • 401 예외 처리 추가
  • 누락된 사용자 초기화 정보 추가
  • 테스트 코드 보완
  • 패키지 정리, 네이밍 변경 (manager -> provider 통일)
  • userKey resolver 구현

고민한 점들(필수 X)

인수 테스트 주석 처리해놓은 부분은 다음 PR로 올리겠습니닷

스크린샷(필수 X)

여기에 작성하세요

@songyi00 songyi00 requested a review from kimyu0218 as a code owner July 24, 2024 17:28
Copy link
Collaborator

@kimyu0218 kimyu0218 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

언니!! 수고 많았어!! 👏 👏


@RequiredArgsConstructor
@Component
public class UserKeyResolver implements HandlerMethodArgumentResolver {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

언니가 말한 게 이거구나!!

@@ -31,7 +31,7 @@ public JwtManager(
this.refreshExpiresIn = refreshExpiresIn;
}

public Jwt generateTokens(String subject) {
public com.nexters.goalpanzi.common.jwt.Jwt generateTokens(String subject) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아..? 이름을 Jwt 말고 딴걸로 할 걸 그랬나....!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 이거 import 다시 제거해서 없애놨어 ㅎㅎ

NativeWebRequest webRequest, WebDataBinderFactory binderFactory) {
HttpServletRequest request = (HttpServletRequest) webRequest.getNativeRequest();

String token = jwtParser.resolveToken(request);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오오 신기하다,, request만 넘겨도 알아서 토큰을 찾아서 파싱하는거야? 공부해봐야 겠다 👍👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

토큰 찾아서 파싱하는건 직접 구현한거고 클라이언트가 요청할 때 argument resolver 타서 파라미터에 특정 조건이 있는 경우에 값 바인딩 가능하게 구현해준거야!!

@songyi00 songyi00 merged commit a60f69b into develop Jul 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants