Hey, I'm struggling with the following CORS error, i also look at this topic https:// laracasts.com/discuss/channels/laravel/error-cors-policy-no-access-control-allow-origin-with-laravel-11 it's the same error but it doesn't work for me.
Can't post Links here so I make space after the https://
This is the error I get: "Access to XMLHttpRequest at 'https:// domain1.com/path1' (redirected from 'http:// domain2:8086/auth/steam') from origin 'http:// domain2:8086' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."
Setup is a wsl2 with Laravel 11, Vue3 and Inertia. I want to make a Login for Steam with Socialite. I test it also with the discord driver but same error. Everytime when i click on the login link for steam i get the CORS error. If I click in the console on the redirect link to steam it works fine
So looks like the route of my routes/web.php
<?php
use App\Http\Controllers\Auth\SteamController;
use Illuminate\Support\Facades\Route;
Route::get('/auth/steam', [SteamController::class,'redirect']);
Route::get('/auth/steam/callback', SteamController::class,'handleCallback');
And the cors.php so
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https:// developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie','auth/steam'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];
so I'm currently a bit confused as to what the problem might be.