diff --git a/frontend/config/main.php b/frontend/config/main.php index 4285610..3c6ec8f 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -1,4 +1,7 @@ [ + 'class' => GsCors::class, + 'cors' => [ + 'Origin' => ['*'], + //'Access-Control-Allow-Credentials' => true, + 'Access-Control-Allow-Headers' => [ + 'Access-Control-Allow-Origin', + 'Access-Control-Allow-Methods', + 'Content-Type', + 'Access-Control-Allow-Headers', + 'Authorization', + 'X-Requested-With' + ], + 'Access-Control-Allow-Methods' => ['POST', 'GET', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], + 'Access-Control-Request-Method' => ['POST', 'GET', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], + ] + ], 'request' => [ 'csrfParam' => '_csrf-frontend', 'baseUrl' => '', @@ -95,6 +114,8 @@ return [ 'GET api/tg-bot/dialog/user/id' => 'api/user-tg-bot/get-user-id-by-dialog-id', 'GET api/tg-bot/dialog/dialog/id' => 'api/user-tg-bot/get-dialog-id-by-user-id', + 'GET api/tg-bot/auth' => 'api/user-tg-bot/auth', + ['class' => 'yii\rest\UrlRule', 'controller' => 'skills'], ],