-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathWebConfig.java
23 lines (19 loc) · 995 Bytes
/
WebConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package nextstep.app.config;
import lombok.RequiredArgsConstructor;
import nextstep.security.constants.SecurityConstants;
import nextstep.security.interceptor.BasicAuthInterceptor;
import nextstep.security.interceptor.UsernamePasswordInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@RequiredArgsConstructor
public class WebConfig implements WebMvcConfigurer {
private final UsernamePasswordInterceptor usernamePasswordInterceptor;
private final BasicAuthInterceptor basicAuthInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
// registry.addInterceptor(usernamePasswordInterceptor).addPathPatterns(SecurityConstants.LOGIN_URL);
// registry.addInterceptor(basicAuthInterceptor).excludePathPatterns(SecurityConstants.LOGIN_URL);
}
}