package thyyxxk.webserver.config.auth;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author dj
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Value("${is-prod}")
    public Boolean isProd;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthenticationInterceptor(isProd))
                .addPathPatterns("/**")
                .excludePathPatterns("/patient360/**");
    }
}
