Skip to content

Commit

Permalink
Fix check for exception details in Auth::verifyChallenge as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Oct 18, 2022
1 parent cec506c commit c0a9265
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Cms/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,11 @@ class_exists(static::$challenges[$challenge]) === true &&

throw new LogicException('Invalid authentication challenge: ' . $challenge);
} catch (Throwable $e) {
$details = is_a($e, 'Kirby\Exception\Exception') === true ? $e->getDetails() : [];

if (
empty($email) === false &&
($e->getDetails()['reason'] ?? null) !== 'rate-limited'
($details['reason'] ?? null) !== 'rate-limited'
) {
$this->track($email);
}
Expand Down

0 comments on commit c0a9265

Please sign in to comment.