I have the subject environment in linux. I have made the configuration of cors.conf, session.conf, kernel:api with EnsureFrontendRequestsAreStateful, .env. All that is raccomanated in all documentation that i read. Laravel in localhost:8000 Angular in localhost:4200
In particular:
Kernel.php:
'api' => [
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
...
cors.php
'paths' => [
'api/*',
'login',
'logout',
'sanctum/csrf-cookie'
],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,
sanctum.php
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', 'localhost:4200,localhost,localhost:8000,127.0.0.1,127.0.0.1:4200,127.0.0.1:8000')),
in .env
SESSION_DOMAIN=.localhost
In Angular when i get csrf-cookie respons is:
Bloccata richiesta multiorigine (cross-origin): il criterio di corrispondenza dell’origine non consente la lettura della risorsa remota da http://localhost:8000/sanctum/csrf-cookie. Motivo: richiesta CORS non riuscita.
this is my stack:
where am i wrong? Thank's before.