From 64eed2b08cce474cd3beea4303c94e186867cbc1 Mon Sep 17 00:00:00 2001
From: Dorian Merz <merz@ub.uni-leipzig.de>
Date: Fri, 21 Jun 2019 13:06:03 +0200
Subject: [PATCH] refs #15452 [fid] ILSAuthenticator bug fix

---
 module/fid/src/VuFind/Auth/ILSAuthenticator.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/module/fid/src/VuFind/Auth/ILSAuthenticator.php b/module/fid/src/VuFind/Auth/ILSAuthenticator.php
index 8b4ad8e20a9..912da0374f3 100644
--- a/module/fid/src/VuFind/Auth/ILSAuthenticator.php
+++ b/module/fid/src/VuFind/Auth/ILSAuthenticator.php
@@ -42,8 +42,13 @@ class ILSAuthenticator
      */
     public function storedCatalogLogin()
     {
-        $user = $this->client->requestUserDetails();
-
+        try {
+            $user = $this->client->requestUserDetails();
+        } catch (ClientException $e) {
+            if ($e->getCode() == '401') {
+                return null;
+            } else throw $e;
+        }
         if (!$user) {
             return null;
         }
-- 
GitLab