leisure.springboot.authorization.AuthorizationInterceptorConfig Maven / Gradle / Ivy
The newest version!
package leisure.springboot.authorization;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@Conditional(AuthorizationCondition.class)
public class AuthorizationInterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new AuthorizationInterceptor());
}
}