9주차 과제 [루크]#22
Open
yujining3827 wants to merge 68 commits into
Open
Conversation
yangjiae12
approved these changes
May 31, 2026
Comment on lines
+44
to
+50
| public String getEmail(String token) { | ||
| try { | ||
| return getClaims(token).getPayload().getSubject(); // Parsing해서 Subject 가져오기 | ||
| } catch (JwtException e) { | ||
| return null; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
JWT 파싱 실패 시 null을 반환하기보다 예외를 그대로 위임하는 것이 더 안전할 것 같습니다! null 반환은 호출부에서 예상치 못한 NPE를 유발할 수 있어, 현재처럼 필터에서 예외를 처리하는 구조라면 getEmail()은 값을 반환하는 책임만 갖도록 분리하는 것도 좋을 것 같습니다~
Comment on lines
+46
to
+47
| // Bearer이면 추출 | ||
| token = token.replace("Bearer ", ""); |
Member
There was a problem hiding this comment.
이미 Bearer 로 시작하는지 검증한 상태라면 replace()보다 substring(7)이 의도를 조금 더 명확하게 표현할 수 있을 것 같습니다~
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚩 관련 이슈
📌 구현 결과
❶ JWT 기반 인증/인가 기능 구현
Security FilterChain) 등록JwtAuthFilter를 통해Authorization헤더의AccessToken검증 로직 구현❷ 회원가입 기능 개선
[기존 코드에서 수정]
[추가 기능]
❸ 로그인 기능 구현
❹ 사용자 인증 정보 기반 API 개선
@AuthenticationPrincipal을 사용하여 인증 사용자 정보 조회❓ 리뷰 요청
🤔 질문
💬 기타 공유 사항