Commit 5795522f by Alexander Makarov

Use Yii::$app->user->login result in LoginForm

parent effc41c1
...@@ -50,8 +50,7 @@ class LoginForm extends Model ...@@ -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;
} }
......
...@@ -50,8 +50,7 @@ class LoginForm extends Model ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment