feat/175: AccessToken으로 만들어진 SCH의 Authentication으로부터 userId와 role 조회 #177
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.



resolved :
📌 과제 설명
Header의 Authorization 값에 담긴 AccessToken으로부터 USER_ID와 ROLE을 발급해야 합니다.
Cookie의 AccessToken이 HttpOnly로 관리되기를 원했기 때문에 JavaScript로 이를 직접 다룰 수 없어, 이를 처리하기 위한 별도의 컨트롤러를 제공해야 했습니다.
👩💻 요구 사항과 구현 내용
✅ PR 포인트 & 궁금한 점
그래서 SecurityContextHolder에서 Authentication 객체를 가져오는 방식을 사용했습니다.
이는 기관과 봉사자 모두를 조회해야 했고, 단일 요청으로 응답을 제공할 필요가 있었기 때문입니다.