Skip to content

Commit

Permalink
feat: set passwordIsValid to false
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Mar 2, 2023
1 parent d22dad9 commit 29a9721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Auth.php
Expand Up @@ -51,13 +51,13 @@ public static function login(array $credentials)
}

if (static::$settings['AUTH_NO_PASS'] === false) {
$passwordIsValid = true;
$passwordIsValid = false;

if (static::$settings['PASSWORD_VERIFY'] !== false && isset($user[$passKey])) {
if (is_callable(static::$settings['PASSWORD_VERIFY'])) {
$passwordIsValid = call_user_func(static::$settings['PASSWORD_VERIFY'], $password, $user[$passKey]);
} else if (static::$settings['PASSWORD_VERIFY'] === Password::MD5) {
$passwordIsValid = (md5($password) === $user[$passKey]);
$passwordIsValid = md5($password) === $user[$passKey];
} else {
$passwordIsValid = Password::verify($password, $user[$passKey]);
}
Expand Down

0 comments on commit 29a9721

Please sign in to comment.