mandant-crm/backend/app/Exceptions
Tim Stollberg abbd92ef85 fix(auth): return JSON 401 for unauthenticated requests unconditionally
The previous Authenticate::redirectTo() -> null fix was incomplete:
Laravel's default Handler::unauthenticated() still falls back to
route('login') via '$exception->redirectTo() ?? route('login')'
whenever the request isn't detected as expectsJson() (no Accept:
application/json or X-Requested-With header), which throws
RouteNotFoundException since this app has no named login route.

Override unauthenticated() directly so this pure-API backend always
returns a JSON 401, regardless of request headers.
2026-07-18 16:09:04 +07:00
..
Handler.php fix(auth): return JSON 401 for unauthenticated requests unconditionally 2026-07-18 16:09:04 +07:00