Skip to content

Commit

Permalink
Fix check for exception details
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Oct 18, 2022
1 parent 92a16d5 commit cec506c
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 @@ -549,8 +549,10 @@ public function validatePassword(string $email, string $password)
]
]);
} catch (Throwable $e) {
$details = is_a($e, 'Kirby\Exception\Exception') === true ? $e->getDetails() : [];

// log invalid login trial unless the rate limit is already active
if (($e->getDetails()['reason'] ?? null) !== 'rate-limited') {
if (($details['reason'] ?? null) !== 'rate-limited') {
try {
$this->track($email);
} catch (Throwable $e) {
Expand Down

0 comments on commit cec506c

Please sign in to comment.