18 lines
659 B
Kotlin
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()
|
|
} |