Level 6
Solved the issue!
I have multi tenancy backend(laravel - tenancyforlaravel) with subdomain identification with vue SPA frontend, and It work perfectly for central domain 'test:5173 - frontend' and 'test:8000 - backend' but for subdomain this issue happen:
test.localhost/:1 Access to XMLHttpRequest at 'http://test.localhost/api/v1' from origin 'http://test.localhost:5173' 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.
This is my cors file:
<?php
return [
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [''],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];
So how to make sure CORS accept any subdomain wildcard? or solve the issue?
Solved the issue!
Please or to participate in this conversation.