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: 토큰에 권한이 비어있을 경우 role 추가하지 않도록 변경 #449

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

gusah009
Copy link
Member

🔥 Related Issue

close: #447

📝 Description

JwtUtils에서 role을 반환할 때 SimpleGrantedAuthority 객체에 담아서 반환해주고 있었는데,

image

SimpleGrantedAuthority 구현을 살펴보면 hasText가 아니면 exception을 반환하도록 되어 있습니다.

image

그런데 이 SimpleGrantedAuthority 객체의 exception을 반환하는 위치가 security의 filter단이라 WebMVC의 ControllerAdvice를 타지 못하는 것으로 보입니다. 그래서 아래와 같이 이상한 응답이 나가는 것으로 보여요.

image

권한이 없으면 권한이 없는대로 일단 진행하고, 각 API에서 401이나 403을 뱉는게 맞다고 판단해서 권한이 없어도 해당 filter는 통과하도록 수정했습니다.

⭐️ Review Request

리뷰어에게 전달하고 싶은 내용을 적어주세요.

@gusah009 gusah009 self-assigned this May 27, 2024
Copy link
Member

@hyuunnn hyuunnn left a comment

Choose a reason for hiding this comment

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

👍👍

Copy link
Collaborator

@02ggang9 02ggang9 left a comment

Choose a reason for hiding this comment

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

굳굳입니다!!! bbb~

Copy link
Collaborator

@yeochaeeon yeochaeeon left a comment

Choose a reason for hiding this comment

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

수고하셨습니당~!!!

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.

[BUG] Token 권한 문제
4 participants