Skip to content

Commit b46427c

Browse files
authored
Fix #19581: Fix regression in CompositeAuth introduced in #19418
1 parent feb637b commit b46427c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Yii Framework 2 Change Log
2020
- Bug #19668: Fix Error null check PHP 8.1 `yii\validators\FilterValidator` (samuelexyz)
2121
- Bug #19670: Fix Error null check PHP 8.1 `yii\rbac\DbManager` (samuelexyz)
2222
- Bug #19520: Fix for TIMESTAMP & ROWVERSION columns in MSSQL insert query (darkdef)
23+
- Bug #19581: Fix regression in `CompositeAuth` introduced in #19418 (SamMousa, WinterSilence, samdark)
2324

2425

2526
2.0.46 August 18, 2022

filters/auth/CompositeAuth.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace yii\filters\auth;
99

1010
use Yii;
11+
use yii\base\ActionFilter;
1112
use yii\base\Controller;
1213
use yii\base\InvalidConfigException;
1314

@@ -73,10 +74,17 @@ public function authenticate($user, $request, $response)
7374

7475
if (
7576
$this->owner instanceof Controller
76-
&& (!isset($this->owner->action) || !$auth->isActive($this->owner->action))
77+
&& (
78+
!isset($this->owner->action)
79+
|| (
80+
$auth instanceof ActionFilter
81+
&& !$auth->isActive($this->owner->action)
82+
)
83+
)
7784
) {
7885
continue;
7986
}
87+
8088
$identity = $auth->authenticate($user, $request, $response);
8189
if ($identity !== null) {
8290
return $identity;

0 commit comments

Comments
 (0)