user login cors

This commit is contained in:
andrey 2021-08-02 18:37:12 +03:00
parent aeb19f7475
commit f422a70fc3

View File

@ -3,6 +3,8 @@
namespace frontend\modules\api\controllers;
use common\behaviors\GsCors;
use common\classes\Debug;
use common\models\User;
use frontend\modules\api\models\LoginForm;
use Yii;
@ -29,6 +31,19 @@ class UserController extends ActiveController
'authenticatior' => [
'class' => QueryParamAuth::class, //implement access token authentication
'except' => ['login'], // no need to verify the access token method, pay attention to distinguish between $noAclLogin
],
'corsFilter' => [
'class' => GsCors::class,
'cors' => [
'Origin' => ['*'],
//'Access-Control-Allow-Credentials' => true,
'Access-Control-Allow-Headers' => [
'Content-Type',
'Access-Control-Allow-Headers',
'Authorization',
'X-Requested-With'
],
]
]
]);
}