diff --git a/src/main/java/codesquad/fineants/spring/config/WebConfig.java b/src/main/java/codesquad/fineants/spring/config/WebConfig.java index a2ee2a05c..321d5076c 100644 --- a/src/main/java/codesquad/fineants/spring/config/WebConfig.java +++ b/src/main/java/codesquad/fineants/spring/config/WebConfig.java @@ -1,17 +1,30 @@ package codesquad.fineants.spring.config; +import java.util.List; + import org.springframework.context.annotation.Configuration; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import codesquad.fineants.domain.oauth.support.AuthPrincipalArgumentResolver; import codesquad.fineants.spring.intercetpor.LogoutInterceptor; +import lombok.RequiredArgsConstructor; @Configuration +@RequiredArgsConstructor public class WebConfig implements WebMvcConfigurer { + private final AuthPrincipalArgumentResolver authPrincipalArgumentResolver; + @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new LogoutInterceptor()) .addPathPatterns("/api/auth/logout"); } + + @Override + public void addArgumentResolvers(List resolvers) { + resolvers.add(authPrincipalArgumentResolver); + } }