Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
riculum committed Apr 19, 2022
1 parent e869084 commit 73f0b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ static function login(string $email, string $password): bool
}

if (password_verify($password, $currentUser['password']) && $currentUser['attempts'] < self::MAX_LOGIN_ATTEMPTS && $currentUser['enabled'] == 1) {
User::login($currentUser['id']);
User::login($currentUser['uuid']);
} else if ($currentUser['enabled'] != 1) {
throw new UserNotEnabledException('User account has been deactivated');
} else if ($currentUser['attempts'] >= self::MAX_LOGIN_ATTEMPTS) {
throw new TooManyAttemptsException('Too many failed login attempts');
} else {
User::setUser($currentUser['id'], ['attempts' => $currentUser['attempts'] + 1]);
User::setUser($currentUser['uuid'], ['attempts' => $currentUser['attempts'] + 1]);
throw new InvalidPasswordException('Incorrect Password');
}

Expand Down

0 comments on commit 73f0b45

Please sign in to comment.