This repository has been archived on 2018-02-23. You can view files and clone it, but cannot push or open issues or pull requests.
url-shortener/src/main/kotlin/net/cismon/urlshortener/configuration/WebConfig.kt

18 lines
659 B
Kotlin

package net.cismon.urlshortener.configuration
import net.cismon.urlshortener.interceptor.AuthInterceptor
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@Configuration
open class WebConfig : WebMvcConfigurerAdapter() {
override fun addInterceptors(registry: InterceptorRegistry) {
registry.addInterceptor(authInterceptor()).addPathPatterns("/manage/**")
}
@Bean
open fun authInterceptor() = AuthInterceptor()
}