diff --git a/app/Config/Cors.php b/app/Config/Cors.php index 2b4edf6..cdbe965 100644 --- a/app/Config/Cors.php +++ b/app/Config/Cors.php @@ -34,7 +34,7 @@ class Cors extends BaseConfig * - ['http://localhost:8080'] * - ['https://www.example.com'] */ - 'allowedOrigins' => [], + 'allowedOrigins' => ['http://localhost:5173', 'https://clqms01.services-summit.my.id/'], /** * Origin regex patterns for the `Access-Control-Allow-Origin` header. @@ -57,7 +57,7 @@ class Cors extends BaseConfig * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials */ - 'supportsCredentials' => false, + 'supportsCredentials' => true, /** * Set headers to allow. @@ -68,7 +68,7 @@ class Cors extends BaseConfig * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers */ - 'allowedHeaders' => [], + 'allowedHeaders' => ['Content-Type', 'Authorization', 'X-Requested-With'], /** * Set headers to expose. @@ -93,7 +93,7 @@ class Cors extends BaseConfig * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods */ - 'allowedMethods' => [], + 'allowedMethods' => ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], /** * Set how many seconds the results of a preflight request can be cached. diff --git a/app/Config/Filters.php b/app/Config/Filters.php index eb46a1d..859c192 100644 --- a/app/Config/Filters.php +++ b/app/Config/Filters.php @@ -69,6 +69,7 @@ class Filters extends BaseFilters */ public array $globals = [ 'before' => [ + 'cors', // 'honeypot', // 'csrf', // 'invalidchars',