Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed Apr 27, 2024
1 parent adaa571 commit 943e804
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions web/lib/MRBS/Auth/AuthDbExt.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,8 @@ public function validateUser(

$stmt = $this->connection()->query($query, $sql_params);

if ($stmt->count() === 1) // force a unique match
{
$row = $stmt->next_row();
if ($this->password_check($pass, $row[0]))
{
return $user;
}
}

return false;
// Check whether (a) there's just one result and (b) that password matches
return (($stmt->count() === 1) && $this->password_check($pass, $stmt->next_row()[0])) ? $user : false;
}


Expand Down

0 comments on commit 943e804

Please sign in to comment.