22 lines
540 B
PHP
22 lines
540 B
PHP
<?php
|
|
|
|
$frontendUrl = (string) env(
|
|
'FRONTEND_URL',
|
|
'https://localhost:5173',
|
|
);
|
|
$allowedOrigins = array_values(array_unique([
|
|
$frontendUrl,
|
|
str_replace('localhost', '127.0.0.1', $frontendUrl),
|
|
str_replace('127.0.0.1', 'localhost', $frontendUrl),
|
|
]));
|
|
|
|
return [
|
|
'paths' => ['api/*'],
|
|
'allowed_methods' => ['*'],
|
|
'allowed_origins' => $allowedOrigins,
|
|
'allowed_origins_patterns' => [],
|
|
'allowed_headers' => ['*'],
|
|
'exposed_headers' => [],
|
|
'max_age' => 0,
|
|
'supports_credentials' => true,
|
|
];
|