-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#31 fix: AuthPrincipalArgumentResolver 설정 추가
- 로그인한 사용자의 정보가 담긴 AuthMember 매개변수에 정보를 넣어주기 위해서 리졸버를 추가하였습니다.
- Loading branch information
1 parent
f44d012
commit 43a863f
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/codesquad/fineants/spring/config/WebConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<HandlerMethodArgumentResolver> resolvers) { | ||
resolvers.add(authPrincipalArgumentResolver); | ||
} | ||
} |