vendor\yiisoft\yii2\filters\RateLimiter.php
public function beforeAction($action)
{
if ($this->user === null && Yii::$app->getUser()) {
$this->user = Yii::$app->getUser()->getIdentity(false);
} else {
$this->user = $this->user->getIdentity(false); // this
}