Skip to content

fix: 마이페이지 403 버그 해결 (#162)#163

Merged
pykido merged 1 commit into
developfrom
Bug/#162-마이페이지-403-버그-해결
Jun 24, 2026

Hidden character warning

The head ref may contain hidden characters: "Bug/#162-\ub9c8\uc774\ud398\uc774\uc9c0-403-\ubc84\uadf8-\ud574\uacb0"
Merged

fix: 마이페이지 403 버그 해결 (#162)#163
pykido merged 1 commit into
developfrom
Bug/#162-마이페이지-403-버그-해결

Conversation

@pykido

@pykido pykido commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

🔥 연관된 이슈

close: #162

📜 작업 내용

  • 로그인 후 마이페이지 GET 요청 시 403이 발생하는 버그를 해결했습니다.
  • 원인은 PR Refactor/#147 member role type 추가 #149(회원학생 role 일괄 변경)에서 SecurityConfig의 전역 인가 규칙이 누락된 것이었습니다.
    • @Secured("ROLE_회원") 패턴은 일괄 치환에 걸렸지만, hasAnyRole("회원")ROLE_ 접두어가 없어 빠졌습니다.
  • 전역 규칙의 role 이름을 현재 enum 기준으로 수정했습니다.
- .anyRequest().hasAnyRole("회원", "관리자", "팀장", "팀원")
+ .anyRequest().hasAnyRole("학생", "관리자", "교수", "직원", "외부멘토")
  • 팀장/팀원TeamMemberRoleType이라 JWT 권한에 포함되지 않아 제거했습니다.

💬 리뷰 요구사항

  • 동일 유형(권한 문자열 불일치)으로 코드 전체를 확인했고, 해당 누락은 이 한 곳이 유일했습니다.

✨ 기타

  • 감사합니다!

Copilot AI review requested due to automatic review settings June 23, 2026 18:18
@pykido
pykido requested review from JJimini, myeowon and sjmoon00 June 23, 2026 18:19
@pykido pykido self-assigned this Jun 23, 2026
@pykido pykido added ‼️P1 우선순위 매우 높음 🐞 버그 예기치 못한 동작 발생 labels Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a 403 on “마이페이지” endpoints by restoring the missing global authorization role mapping in SecurityConfig after the earlier “회원 → 학생” role refactor.

Changes:

  • Updates the default (anyRequest) access rule from legacy roles (회원, 팀장, 팀원) to the current MemberRoleType-aligned roles (학생, 관리자, 교수, 직원, 외부멘토).
  • Removes 팀장/팀원 from the global rule since they are TeamMemberRoleType and not part of JWT/Spring Security authorities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pykido
pykido merged commit 1f66b2f into develop Jun 24, 2026
1 check passed
@pykido
pykido deleted the Bug/#162-마이페이지-403-버그-해결 branch June 24, 2026 12:43
pykido added a commit that referenced this pull request Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

‼️P1 우선순위 매우 높음 🐞 버그 예기치 못한 동작 발생

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 마이페이지 403 버그 해결

4 participants