mandant-crm/backend/app/Http/Middleware/Authenticate.php
Tim Stollberg 837c91019f fix(auth): stop redirecting unauthenticated requests to nonexistent login route
No named 'login' route exists anywhere in this app (it's a pure API
backend for the Nuxt SPA). Authenticate::redirectTo() called
route('login') for any request without an explicit Accept: application/json
header, throwing RouteNotFoundException and surfacing as a 500 instead
of the expected 401.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 15:42:33 +07:00

17 lines
366 B
PHP

<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*/
protected function redirectTo(Request $request): ?string
{
return null;
}
}