Skip to content

Commit

Permalink
Catch errors from user.login:failed hook
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbestle committed Oct 17, 2022
1 parent cf0b8c7 commit 38214ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Cms/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,12 @@ public function validatePassword(string $email, string $password)
} catch (Throwable $e) {
// log invalid login trial unless the rate limit is already active
if (($e->getDetails()['reason'] ?? null) !== 'rate-limited') {
$this->track($email);
try {
$this->track($email);
} catch (Throwable $e) {
// $e is overwritten with the exception
// from the track method if there's one
}
}

// sleep for a random amount of milliseconds
Expand Down

0 comments on commit 38214ac

Please sign in to comment.