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

[bug] AuthMember 문제 #31

Closed
yonghwankim-dev opened this issue Nov 24, 2023 · 0 comments
Closed

[bug] AuthMember 문제 #31

yonghwankim-dev opened this issue Nov 24, 2023 · 0 comments
Assignees
Labels
bug Something isn't working feat 기능

Comments

@yonghwankim-dev
Copy link
Member

yonghwankim-dev commented Nov 24, 2023

상황

로그인 후 포트폴리오 목록 조회와 같이 컨트롤러 매핑 메소드의 AuthMember 매개변수에 로그인한 사용자 정보를 전달하지 못하고 있습니다.

원인

seucirty 라이브러리 적용 과정에서 AuthPrincipalArgumentResolver를 설정한 WebConfig 파일이 제거되면서 설정되지 않아서 Resolver가 작동하지 않아서 입니다.

해결방법

WebConfig 파일에 AuthPrincipalArgumentResolver를 설정 추가합니다.

@Configuration
@RequiredArgsConstructor
public class WebConfig implements WebMvcConfigurer {
	private final AuthPrincipalArgumentResolver authPrincipalArgumentResolver;

	@Override
	public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
		resolvers.add(authPrincipalArgumentResolver);
	}
}
@yonghwankim-dev yonghwankim-dev added bug Something isn't working feat 기능 labels Nov 24, 2023
@yonghwankim-dev yonghwankim-dev self-assigned this Nov 24, 2023
yonghwankim-dev added a commit that referenced this issue Nov 24, 2023
- 로그인한 사용자의 정보가 담긴 AuthMember 매개변수에 정보를 넣어주기 위해서 리졸버를 추가하였습니다.
yonghwankim-dev added a commit that referenced this issue Nov 24, 2023
- 로그인한 사용자의 정보가 담긴 AuthMember 매개변수에 정보를 넣어주기 위해서 리졸버를 추가하였습니다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feat 기능
Projects
None yet
Development

No branches or pull requests

1 participant