Class AuthExceptionHandler

java.lang.Object
com.raphaelsalles.backend.infra.exception.AuthExceptionHandler

@RestControllerAdvice public class AuthExceptionHandler extends Object
Handler de Exceções de Autenticação.

Propósito: Capturar erros específicos do Spring Security e retornar respostas JSON amigáveis.

  • Constructor Details

    • AuthExceptionHandler

      public AuthExceptionHandler()
  • Method Details

    • handleAuthenticationException

      @ExceptionHandler(org.springframework.security.core.AuthenticationException.class) public org.springframework.http.ResponseEntity<String> handleAuthenticationException(org.springframework.security.core.AuthenticationException e)
      Trata falhas de autenticação (ex: senha incorreta).
      Returns:
      Status 401 (Unauthorized).