Skip to content

Commit

Permalink
Update TokenFilter.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
MocStepan authored May 10, 2024
1 parent a2c7dc8 commit 367efda
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import jakarta.servlet.http.HttpServletRequest
import org.springframework.stereotype.Component
import org.springframework.web.util.WebUtils

private val log = KotlinLogging.logger {}

@Component
class TokenFilter(
private val accessTokenService: AccessTokenService
) {

fun validateRequest(request: HttpServletRequest): AccessTokenClaims? {
val token = WebUtils.getCookie(request, accessTokenService.COOKIE_NAME)

log.error { "Token: $token" }
if (token != null) {
return accessTokenService.extractClaims(token.value)
}
Expand Down

0 comments on commit 367efda

Please sign in to comment.