From 26aada15f8de6071b6d6c4135c1a2b2fc7b51795 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Mon, 3 Feb 2025 12:14:33 +0200 Subject: [PATCH] Fix ChoiceAuth getUsernamePolicy and getPasswordPolicy when not logged in. If an authentication strategy is not set, proxyAuthMethod returns false. This does not normally happen, but could be encountered e.g. when trying to refresh a password change form while the session has timed out or user has logged out in another browser window. --- module/VuFind/src/VuFind/Auth/ChoiceAuth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php index 40d074f68bc..06d9df6e8c4 100644 --- a/module/VuFind/src/VuFind/Auth/ChoiceAuth.php +++ b/module/VuFind/src/VuFind/Auth/ChoiceAuth.php @@ -312,7 +312,7 @@ public function supportsPasswordRecovery() */ public function getUsernamePolicy() { - return $this->proxyAuthMethod('getUsernamePolicy', func_get_args()); + return $this->proxyAuthMethod('getUsernamePolicy', func_get_args()) ?: []; } /** @@ -322,7 +322,7 @@ public function getUsernamePolicy() */ public function getPasswordPolicy() { - return $this->proxyAuthMethod('getPasswordPolicy', func_get_args()); + return $this->proxyAuthMethod('getPasswordPolicy', func_get_args()) ?: []; } /**