We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a025d44 commit 90289d5Copy full SHA for 90289d5
models/LoginForm.php
@@ -142,8 +142,13 @@ public function validatePassword($attribute, $params)
142
public function login()
143
{
144
if ($this->validate() && $this->user) {
145
- $this->user->updateAttributes(['last_login_at' => time()]);
146
- return Yii::$app->getUser()->login($this->user, $this->rememberMe ? $this->module->rememberFor : 0);
+ $isLogged = Yii::$app->getUser()->login($this->user, $this->rememberMe ? $this->module->rememberFor : 0);
+
147
+ if ($isLogged) {
148
+ $this->user->updateAttributes(['last_login_at' => time()]);
149
+ }
150
151
+ return $isLogged;
152
}
153
154
return false;
0 commit comments