fix(env): update frontend URL variable and adjust CORS settings for improved origin handling

This commit is contained in:
2026-07-27 14:09:43 -03:00
parent 8a19b0136d
commit 069867522a
2 changed files with 14 additions and 4 deletions

View File

@@ -1,5 +1,13 @@
<?php
$frontendUrls = array_values(array_filter(array_map(
'trim',
explode(',', (string) env(
'FRONTEND_URLS',
env('FRONTEND_URL', 'http://localhost:4200')
))
)));
return [
/*
@@ -19,9 +27,11 @@ return [
'allowed_methods' => ['*'],
'allowed_origins' => [env('FRONTEND_URL', 'http://localhost:4200')],
'allowed_origins' => $frontendUrls,
'allowed_origins_patterns' => [],
'allowed_origins_patterns' => [
'#^https://[a-z0-9-]+\.shopit\.com\.ar$#',
],
'allowed_headers' => ['*'],