Skip to content

Commit

Permalink
error out when user is null not the opposite...
Browse files Browse the repository at this point in the history
  • Loading branch information
proditis committed Apr 30, 2020
1 parent 392dbfc commit dc3a447
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/models/LoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ public function validatePassword($attribute)
{
if (!$this->hasErrors()) {
$user = $this->getUser();
if ($user!==null || !$user->validatePassword($this->password)) {
$this->addError($attribute, 'Incorrect username or password.');
if ($user===null || !$user->validatePassword($this->password)) {
$this->addError($attribute, 'Incorrect username or password.');
}
}

}

/**
Expand Down

0 comments on commit dc3a447

Please sign in to comment.