add api authentication

This commit is contained in:
kirill committed 2021-07-28 18:15:38 +03:00
1 parent 1a2347ef99
commit 3f97cb7c04
5 files changed
+189 -6

No files matched your search

+12
View File
@@ -15,6 +15,15 @@ return [
'modules' => [
'api' => [
'components' => [
'user' => [
'identityClass' => 'frontend\modules\api\models\User',
'enableAutoLogin' => true,
'enableSession' => false,
'class' => 'frontend\modules\api\models\User',
//'identityCookie' => ['name' => '_identity-api', 'httpOnly' => true],
],
],
'class' => 'frontend\modules\api\Api',
],
'access' => [
@@ -32,6 +41,9 @@ return [
'request' => [
'csrfParam' => '_csrf-frontend',
'baseUrl' => '',
'parsers' => [
'application/json' => 'yii\web\JsonParser',
],
],
'user' => [
'identityClass' => 'common\models\User',