package com.bizofficer.configurations;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class AuthenticationInterceptorAppConfig implements WebMvcConfigurer {

		@Autowired
		AuthenticationInterceptor authenticationInterceptor;

	   @Override
	   public void addInterceptors(InterceptorRegistry registry) {
		   List<String> excludeURL = new ArrayList<String>();
		   excludeURL.add("/assets/**");
		   excludeURL.add("/images/**");
		   excludeURL.add("/jquery/**");
		   excludeURL.add("/js/**");
		   excludeURL.add("/login");
	      registry.addInterceptor(authenticationInterceptor).excludePathPatterns(excludeURL);
	      
	   }
	
	   
}
