From 76f1b2716bbbcd6815c110b3c5a97c953f001fc6 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Mon, 3 Feb 2025 15:34:15 +0200 Subject: [PATCH] Fix ChoiceAuth getUsernamePolicy and getPasswordPolicy when not logged in. (#4228) 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()) ?: []; } /**