Skip to content

Commit

Permalink
chore: apply lint
Browse files Browse the repository at this point in the history
  • Loading branch information
junha-ahn committed Oct 14, 2023
1 parent 97a4960 commit 3d3d9ff
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import com.group4.ticketingservice.utils.TokenProvider
import jakarta.servlet.FilterChain
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import java.io.PrintWriter
import org.springframework.security.authentication.AuthenticationManager
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
import org.springframework.security.core.Authentication
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
import java.io.PrintWriter

class JwtAuthenticationFilter(
private val authenticationManager: AuthenticationManager?,
Expand Down Expand Up @@ -42,13 +42,14 @@ class JwtAuthenticationFilter(
chain: FilterChain,
authResult: Authentication
) {

val user = authResult.principal as User
val jwt = tokenProvider.createToken("${user.id}")
val body = gson.toJson(SuccessResponseDTO(
val body = gson.toJson(
SuccessResponseDTO(
path = request.requestURI,
data =mapOf("Authorization" to "Bearer $jwt")
))
data = mapOf("Authorization" to "Bearer $jwt")
)
)

response.contentType = "application/json"
val writer: PrintWriter = response.writer
Expand Down

0 comments on commit 3d3d9ff

Please sign in to comment.