Conversation
기존의 경우 loadUserByUsername을 요청마다 DB 호출 변경: loadUserByUsername 호출을 하지 않음 jwt subject에 email대신 MemberId를 넣음 claim에는 member의 권한을 넣음
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 로직 수정
기존의 경우 loadUserByUsername을 요청마다 DB 호출
변경: loadUserByUsername 호출을 하지 않음
jwt subject에 email대신 MemberId를 넣음
claim에는 member의 권한을 넣음
아래와 같은 스프링 시큐리티에서 기본으로 제공하는 어노테이션을 사용해 Member의 정보를 가져올 수 있음

현재는 member의 id, role 권한만 불러오도록 처리

나중에 어드민 추가되면 해야하는 것