From 2c9a87d794aa4404d808267a61cb109343345756 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Sun, 9 Jun 2024 14:39:02 +0400 Subject: [PATCH] allow null in typehint --- modules/silauth/lib/Auth/Source/auth/Authenticator.php | 2 +- modules/silauth/lib/Auth/Source/models/FailedLoginUsername.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/silauth/lib/Auth/Source/auth/Authenticator.php b/modules/silauth/lib/Auth/Source/auth/Authenticator.php index 2e91ed7e..fd084978 100644 --- a/modules/silauth/lib/Auth/Source/auth/Authenticator.php +++ b/modules/silauth/lib/Auth/Source/auth/Authenticator.php @@ -274,7 +274,7 @@ protected function isBlockedByRateLimit(string $username, array $ipAddresses): b FailedLoginIpAddress::isRateLimitBlockingAnyOfThese($ipAddresses); } - public static function isCaptchaRequired(string $username, array $ipAddresses): bool + public static function isCaptchaRequired(?string $username, array $ipAddresses): bool { return FailedLoginUsername::isCaptchaRequiredFor($username) || FailedLoginIpAddress::isCaptchaRequiredForAnyOfThese($ipAddresses); diff --git a/modules/silauth/lib/Auth/Source/models/FailedLoginUsername.php b/modules/silauth/lib/Auth/Source/models/FailedLoginUsername.php index 26615487..4b67faac 100644 --- a/modules/silauth/lib/Auth/Source/models/FailedLoginUsername.php +++ b/modules/silauth/lib/Auth/Source/models/FailedLoginUsername.php @@ -108,7 +108,7 @@ public static function isRateLimitBlocking(string $username): bool return ($secondsUntilUnblocked > 0); } - public static function isCaptchaRequiredFor(string $username): bool + public static function isCaptchaRequiredFor(?string $username): bool { if (empty($username)) { return false;