I try to make authorization on yii2. Created a form and when I send it, I get this error
Argument 1 passed to yii\web\User::login() must implement interface yii\web\IdentityInterface, null given, called in /frontend/models/auth/LoginForm.php on line 79 and defined
This happens, as I understand it, when you call
Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
After reading on the Internet, I found a solution, but it did not help because my User class was created correctly
class User extends ActiveRecord implements IdentityInterface
What to do, what would not be this error?
> Argument 1 ... null given ...
... Your$this->getUser()
method returnsnull
, not the user's identity. Show it to us ... - Roman Grinyov