Adds JWT-based auth with refresh tokens
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package net.halfbinary.scavengerhuntapi.config
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest
|
||||
import jakarta.servlet.http.HttpServletResponse
|
||||
import org.springframework.security.core.AuthenticationException
|
||||
import org.springframework.security.web.AuthenticationEntryPoint
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class AuthEntrypointJwt: AuthenticationEntryPoint {
|
||||
override fun commence(
|
||||
request: HttpServletRequest,
|
||||
response: HttpServletResponse,
|
||||
authException: AuthenticationException
|
||||
) {
|
||||
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException.message)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user