AuthErrorHandler
works.iterative.server.http.AuthErrorHandler
object AuthErrorHandler
Error handler for authentication and authorization failures.
This object provides HTTP4S response mapping for AuthenticationError enum variants. It ensures consistent error responses across the application:
- Unauthenticated → 401 Unauthorized
- Forbidden → 403 Forbidden
- InvalidCredentials → 401 Unauthorized
- TokenExpired → 401 Unauthorized
- InvalidToken → 401 Unauthorized
Usage in HTTP routes:
service.updateDocument(id, title)
.mapError {
case e: AuthenticationError => AuthErrorHandler.toResponse(e)
}
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AuthErrorHandler.type
Members list
In this article