Hello to everyone!
I will go straight to the subject of my question.
Question: I made, a custom login system , that retrieves data, from a table ,from a localhost ,xampp, php my admin. But whenever ,I try to login, it seems that the id ,of every, user, is passed , but still though, Yii2, does not login my custom user.?
Anyone, had this issue before?
I searched but still ,got no answer.
'components' => [
'user' => [
'identityClass' => 'app\models\User', //Typically your db model that used for login
'enableAutoLogin' => true,
]
]
As well please make sure you have implemented IdentityInterface in your model as follows! class User extends \yii\db\ActiveRecord implements IdentityInterface
In your controller make sure to call auto login!
$model = new User();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack(); // Whatever your success operations
} else {
// Your failiure error message collections
}