-
Notifications
You must be signed in to change notification settings - Fork 0
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
인증객체 ,ArgumentResolver추가 #18
Conversation
* spring security에 비해 익숙하고 간단한 ArgumentResolver로 구현
@Override | ||
public boolean supportsParameter(MethodParameter parameter) { | ||
return parameter.getParameterType().equals(AuthenticationMember.class); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 메소드는 해당 파라미터가 컨트롤러에서 처리할 수 있는 파라미터 타입인지 확인하는 거 맞나요 ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 맞습니다 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 클래스는 어디서 사용되나요 ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pr 스크린샷에 명시해뒀습니다
@Override | ||
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) { | ||
resolvers.add(new AuthResolver(memberRepository, jwtProvider)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 메소드는 어떤 일을 하는건가용
AuthResolver를 생성하면서 memberRepository와 jwtProvider를 주입하게 되면 어떻게 되는지 궁금합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단순하게 생성자 주입이라고 생각하시면 될것같습니다 AuthResolver에서 memberRepository와 jwtProvider를 사용할수있게됩니다~~~
고생하셨숩니다 ~결국 spring security 안쓰시는 방향으로 하셨군요! |
일정때문에 빨리 선택하게되었어요 나중에 경험으로 개선포인트 욕심이 있긴합니다~~ |
What is this PR? 🔍
Screenshot 📷
위와같이 컨트롤러 parameter에 resolver에 등록한 객체(AuthenticationMember)가 있는경우 해당 메서드 실행전에 resolver가 실행되고 Member에대한 정보를 컨트롤러로 반환