mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Реализована логика oAuth авторизации приложений, добавлен Redis, удалены лишние тесты, пофикшены старые.
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
namespace api\controllers;
|
||||
|
||||
use api\traits\ApiNormalize;
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* @property \common\models\Account|null $account
|
||||
*/
|
||||
class Controller extends \yii\rest\Controller {
|
||||
use ApiNormalize;
|
||||
|
||||
public $enableCsrfValidation = true;
|
||||
|
||||
public function behaviors() {
|
||||
$parentBehaviors = parent::behaviors();
|
||||
// xml нам не понадобится
|
||||
@@ -16,4 +18,11 @@ class Controller extends \yii\rest\Controller {
|
||||
return $parentBehaviors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \common\models\Account|null
|
||||
*/
|
||||
public function getAccount() {
|
||||
return Yii::$app->getUser()->getIdentity();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user