Исправлена проверка авторизации для запроса на refresh-token

This commit is contained in:
ErickSkrauch 2016-12-13 01:10:05 +03:00
parent f2e6df4022
commit 6d4bef0549
2 changed files with 4 additions and 3 deletions

View File

@ -110,7 +110,7 @@ class Component extends YiiUserComponent {
return $result;
}
public function renew(AccountSession $session) {
public function renew(AccountSession $session): RenewResult {
$account = $session->account;
$transaction = Yii::$app->db->beginTransaction();
try {

View File

@ -17,13 +17,14 @@ class AuthenticationController extends Controller {
public function behaviors() {
return ArrayHelper::merge(parent::behaviors(), [
'authenticator' => [
'except' => ['login', 'forgot-password', 'recover-password', 'refresh-token'],
'only' => ['logout'],
],
'access' => [
'class' => AccessControl::class,
'except' => ['refresh-token'],
'rules' => [
[
'actions' => ['login', 'forgot-password', 'recover-password', 'refresh-token'],
'actions' => ['login', 'forgot-password', 'recover-password'],
'allow' => true,
'roles' => ['?'],
],