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

fix: JWT decrypt 예외시 AuthException을 던지도록하고, 전역 Advice를 등록 #403

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

devxb
Copy link
Member

@devxb devxb commented Mar 8, 2024

어떤 기능을 개발했나요?

Jwt decrypt 예외시 500 에러가 발생하고 있어서, 핸들링 로직을 추가했습니다.

어떻게 해결했나요?

  • JWT decrypt 과정에서 예외 발생시 AuthException 던지도록 수정
  • 전역 AuthExceptionHandler 추가

이슈 넘버

참고자료

@devxb devxb self-assigned this Mar 8, 2024
Copy link

sonarqubecloud bot commented Mar 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member

@dojinyou dojinyou left a comment

Choose a reason for hiding this comment

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

지금 JWT 받아서 처리하는 컨트롤러가 있나?

@devxb
Copy link
Member Author

devxb commented Mar 8, 2024

지금 JWT 받아서 처리하는 컨트롤러가 있나?

login된 유저 조회 컨트롤러가 쓰는중
user-application 모듈 -> auth-application 모듈

@dojinyou
Copy link
Member

dojinyou commented Mar 8, 2024

전역적으로 AuthToken 체크 있어야 되지 않나?

@devxb
Copy link
Member Author

devxb commented Mar 8, 2024

전역적으로 AuthToken 체크 있어야 되지 않나?

ㅇㅇ 맞으 그래서 @RestControllerAdvice 로 등록했어 이러면 다 잡힐거야

@dojinyou
Copy link
Member

dojinyou commented Mar 8, 2024

나중에 Auth를 필터나 인터셉터에서 잡으면 안 잡히지 않아?

@devxb
Copy link
Member Author

devxb commented Mar 8, 2024

나중에 Auth를 필터나 인터셉터에서 잡으면 안 잡히지 않아?

인터셉터에서 요청 url에 해당하는 핸들러(url 매칭되는 @RestController, @Controller)가 있으면 잡히는거로 알아

@devxb devxb requested a review from dojinyou March 8, 2024 10:57
@devxb devxb merged commit b7802fe into main Mar 8, 2024
5 checks passed
@devxb devxb deleted the devxb/iss-#402 branch March 8, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fix] : Jwt decrypt 실패시 예외 핸들링이 되지 않는 버그 수정
2 participants