diff --git a/framework/filters/auth/CompositeAuth.php b/framework/filters/auth/CompositeAuth.php index 02817d43227..f6d0756cf25 100644 --- a/framework/filters/auth/CompositeAuth.php +++ b/framework/filters/auth/CompositeAuth.php @@ -1,4 +1,5 @@ user; + if ($authUser != null && !$authUser instanceof \yii\web\User) { + throw new InvalidConfigException(get_class($authUser) . ' must implement of a type yii\web\User'); + } elseif ($authUser != null) { + $user = $authUser; + } + $identity = $auth->authenticate($user, $request, $response); if ($identity !== null) { return $identity;