Use Yii::$app->user->login result in LoginForm
This commit is contained in:
parent
302b25026c
commit
abb1a10b89
@ -50,8 +50,7 @@ class LoginForm extends Model
|
|||||||
{
|
{
|
||||||
if ($this->validate()) {
|
if ($this->validate()) {
|
||||||
$user = $this->getUserByUsername($this->username);
|
$user = $this->getUserByUsername($this->username);
|
||||||
Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);
|
return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user