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

#329 로그인 리졸버 유저 검증 로직 추가 #335

Merged
merged 6 commits into from
Jul 15, 2024

Conversation

sojungpp
Copy link
Member

📍 이슈 번호


🛠️ 작업 내용

1. ExceptionAdvice.java @RestControllerAdvice 추가

어노테이션 누락되어 있어서 추가했습니다. f906c54

2. 실행 오류 수정

develop 브랜치 실행했더니 오류가 뜨길래 임의로 해결했습니다. 참고링크 fd32abe

3. 유저 검증 로직 추가

4. LoginResolver return값 UserId(Long type)로 변경

기존 LoginStatus 클래스를 통해 userId를 가져오는 방식에서 userId로만 반환하는 로직으로 변경했습니다.


🎸 기타 사항

1. LoginResolver에서 Service 상속과 Repository 상속

private Long getUserId(String accessToken) {
Long userId = Long.valueOf(tokenUtils.getJwtContents(accessToken));
userService.validateUser(userId);
return userId;
}

resolver가 실행되는 시점이 controller와 동일해서, userService를 거쳐 userRepository에 접근하는 것으로 생각했는데 옳은 방법인지 한 번만 같이 봐주세요 !

2. LoginResolver return값 UserId(Long type)로 변경

이유: LoginResolver에서 이제 유저 상태까지 점검 -> LoginStatus의 isLogin 컬럼 불필요
이점: 리졸버를 통해 바로 userId 반환 가능, 리졸버에서 isLogin 상태 변경 불필요
추가 작업 : LoginStatus 클래스 삭제 -> controller의 IsLogin 어노테이션 반환값 LoginStatus에서 Long으로 변경

만약 괜찮다면, 해당 브랜치에서 추가 작업 이어서 진행하겠습니다 의견 주세욥 !

@sojungpp sojungpp added 🍽 feature 새로운 기능 추가 ♻️ refactor 리팩토링 labels Jul 14, 2024
@sojungpp sojungpp self-assigned this Jul 14, 2024
@sojungpp sojungpp requested a review from psyeon1120 as a code owner July 14, 2024 09:16
@psyeon1120
Copy link
Member

psyeon1120 commented Jul 14, 2024

만약 괜찮다면, 해당 브랜치에서 추가 작업 이어서 진행하겠습니다 의견 주세욥 !

어떤 작업을 이어서 하시는건가요??

이해 완. 이어서 해주시면 좋을 것 같아요!

Copy link
Member

@psyeon1120 psyeon1120 left a comment

Choose a reason for hiding this comment

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

😆

@sojungpp
Copy link
Member Author

만약 괜찮다면, 해당 브랜치에서 추가 작업 이어서 진행하겠습니다 의견 주세욥 !

어떤 작업을 이어서 하시는건가요??

이해 완. 이어서 해주시면 좋을 것 같아요!

반영했습니다 ! 확인하고 머지해주세요 -!

@psyeon1120 psyeon1120 merged commit 694ac05 into develop Jul 15, 2024
1 check passed
@psyeon1120 psyeon1120 deleted the feature/#329-isLogin-resolver branch July 15, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍽 feature 새로운 기능 추가 ♻️ refactor 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] IsLogin 리졸버 유저 검증 로직 추가
2 participants