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] AuthMember 문제 해결 #32

Merged
merged 1 commit into from
Nov 24, 2023
Merged

[fix] AuthMember 문제 해결 #32

merged 1 commit into from
Nov 24, 2023

Conversation

yonghwankim-dev
Copy link
Member

상황

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

원인

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

해결방법

  • WebConfig 파일에 AuthPrincipalArgumentResolver를 설정 추가합니다.
@Configuration
@RequiredArgsConstructor
public class WebConfig implements WebMvcConfigurer {

	private final AuthPrincipalArgumentResolver authPrincipalArgumentResolver;

         // ...

	@Override
	public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
		resolvers.add(authPrincipalArgumentResolver);
	}
}

- 로그인한 사용자의 정보가 담긴 AuthMember 매개변수에 정보를 넣어주기 위해서 리졸버를 추가하였습니다.
@yonghwankim-dev yonghwankim-dev self-assigned this Nov 24, 2023
@yonghwankim-dev yonghwankim-dev added the bug Something isn't working label Nov 24, 2023
@yonghwankim-dev yonghwankim-dev merged commit c5af417 into dev Nov 24, 2023
@yonghwankim-dev yonghwankim-dev deleted the fix/#31-auth branch November 24, 2023 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant