-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30f8fce
commit 2260584
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.meogo.global.config | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import org.meogo.global.error.GlobalExceptionFilter | ||
import org.meogo.global.jwt.JwtTokenFilter | ||
import org.meogo.global.jwt.JwtTokenProvider | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.security.config.annotation.SecurityConfigurerAdapter | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity | ||
import org.springframework.security.web.DefaultSecurityFilterChain | ||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter | ||
|
||
@Configuration | ||
class FilterConfig( | ||
private val objectMapper: ObjectMapper, | ||
private val jwtTokenProvider: JwtTokenProvider | ||
) : SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity>() { | ||
|
||
override fun configure(builder: HttpSecurity) { | ||
builder.addFilterBefore(JwtTokenFilter(jwtTokenProvider), UsernamePasswordAuthenticationFilter::class.java) | ||
builder.addFilterBefore(GlobalExceptionFilter(objectMapper), JwtTokenFilter::class.java) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters