Skip to content

feat: JWT에서 회원 ID 추출 유틸 추가 및 적용#20

Merged
popeye0618 merged 1 commit into
mainfrom
refactor/current-member-id
May 13, 2026
Merged

feat: JWT에서 회원 ID 추출 유틸 추가 및 적용#20
popeye0618 merged 1 commit into
mainfrom
refactor/current-member-id

Conversation

@popeye0618

@popeye0618 popeye0618 commented May 13, 2026

Copy link
Copy Markdown
Contributor

📌 작업 개요

JWT에서 회원 ID 추출 유틸 추가 및 적용

🔗 관련 이슈

  • Closes #

✨ 변경 사항

  • Jwt 확장 함수로 memberId 추출 메서드 추가
  • subject가 숫자가 아닌 경우 INVALID_TOKEN 예외 처리 로직 구현
  • JwtMemberIdTest로 정상/비정상 케이스 테스트 추가
  • SchoolEmailVerificationController에 Jwt.memberId() 메서드를 적용하여 중복 로직 제거

🧪 테스트

  • 단위 테스트 추가/수정
  • 로컬에서 동작 확인

✅ 체크리스트

  • 브랜치명이 Git Flow 컨벤션을 따릅니다 (feature/, fix/, hotfix/ 등)
  • 커밋 메시지가 Conventional Commits 컨벤션을 따릅니다
  • 리뷰 가능한 단위로 작업을 분리했습니다
  • 관련 문서를 업데이트했습니다 (필요 시)

💬 리뷰어에게

@codex

- Jwt 확장 함수로 memberId 추출 메서드 추가
- subject가 숫자가 아닌 경우 INVALID_TOKEN 예외 처리 로직 구현
- JwtMemberIdTest로 정상/비정상 케이스 테스트 추가
- SchoolEmailVerificationController에 Jwt.memberId() 메서드를 적용하여 중복 로직 제거
@popeye0618
popeye0618 merged commit 8cdf12e into main May 13, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 689ef70ea6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +8 to +9
return subject.toLongOrNull()
?: throw BusinessException(CommonErrorCode.INVALID_TOKEN)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge null subject도 INVALID_TOKEN으로 처리하세요

Jwt.subject는 토큰에 sub 클레임이 없으면 null이 될 수 있는데, 현재 구현은 subject.toLongOrNull()을 바로 호출해서 이 경우 NullPointerException이 발생합니다. 그러면 의도한 BusinessException(INVALID_TOKEN)이 아니라 전역 예외 처리에서 500(INTERNAL_ERROR)로 떨어져 잘못된 토큰이 서버 오류처럼 보이게 됩니다. subject?.toLongOrNull()처럼 null-safe 변환 후 실패 시 INVALID_TOKEN을 던지도록 바꿔야 합니다.

Useful? React with 👍 / 👎.

@popeye0618
popeye0618 deleted the refactor/current-member-id branch May 14, 2026 00:56
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.

1 participant