[Bug]: AuthenticationException: Laravels authentication exception doesn't set it's status code to 401, resulting in laravel-api-problem defaulting it to 500. #6
Labels
bug
Something isn't working
What happened?
For what ever reason Laravel's AuthenticationException does not set the exception status code to 401 (defaults 0).
Only when the exception is handled in vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:716 does it grab the get the exception message and return 401 via json response.
laravel-api-problem intercepts the AuthenticationException and the getStatusCode method only sees status code 0, resulting in 500 error for authentication exception.
Expected result would be 401 regardless of status code 0 for an AuthenticationException.
How to reproduce the bug
Use fortify, navigate to an an endpoint that requires authentication will being unauthenticated.
Package Version
Laravel 11
PHP Version
0.03
Laravel Version
11
Which operating systems does with happen with?
Windows
Notes
No response
The text was updated successfully, but these errors were encountered: