mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Добавлен контроллер для блокировки аккаунта
Добавлен client_credentials grant для oAuth Рефакторинг структуры OauthScopes чтобы можно было разделить владельца прав на пользовательские и общие (машинные) Исправлена стилистика кода, внедряются фишки PHP 7.1
This commit is contained in:
@ -7,7 +7,9 @@ use api\components\OAuth2\Exception\AccessDeniedException;
|
||||
use common\models\Account;
|
||||
use common\models\OauthClient;
|
||||
use common\models\OauthScope;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use League\OAuth2\Server\Exception\OAuthException;
|
||||
use League\OAuth2\Server\Grant\AuthCodeGrant;
|
||||
use Yii;
|
||||
use yii\filters\AccessControl;
|
||||
use yii\helpers\ArrayHelper;
|
||||
@ -274,17 +276,12 @@ class OauthController extends Controller {
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \League\OAuth2\Server\AuthorizationServer
|
||||
*/
|
||||
private function getServer() {
|
||||
private function getServer(): AuthorizationServer {
|
||||
return Yii::$app->oauth->authServer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \League\OAuth2\Server\Grant\AuthCodeGrant
|
||||
*/
|
||||
private function getGrantType() {
|
||||
private function getGrantType(): AuthCodeGrant {
|
||||
/** @noinspection PhpIncompatibleReturnTypeInspection */
|
||||
return $this->getServer()->getGrantType('authorization_code');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user