diff --git a/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java b/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java index 8d06093..67e8dcb 100644 --- a/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java +++ b/austin-web/src/main/java/com/java3y/austin/web/config/CrossConfig.java @@ -1,7 +1,9 @@ package com.java3y.austin.web.config; +import com.java3y.austin.web.interceptor.TokenInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** @@ -19,4 +21,9 @@ public class CrossConfig implements WebMvcConfigurer { .maxAge(3600) .allowedHeaders("*"); } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new TokenInterceptor()).addPathPatterns("/**"); + } }