From 0cd12596aa30aef36bc963c5dd1b6e5627bfadfb Mon Sep 17 00:00:00 2001
From: Sebastian Kehr <kehr@ub.uni-leipzig.de>
Date: Wed, 19 Jun 2019 16:54:26 +0200
Subject: [PATCH] refs #15434 [instance/fid] fix erroneous refresh of stale
 logons

---
 module/fid/src/Service/Client.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/fid/src/Service/Client.php b/module/fid/src/Service/Client.php
index 7bdb8eca18f..9211f4e79a8 100644
--- a/module/fid/src/Service/Client.php
+++ b/module/fid/src/Service/Client.php
@@ -381,12 +381,12 @@ class Client
         RequestInterface $request,
         bool $retryOn401 = true
     ): ResponseInterface {
-        $token = $this->restoreLogon()->getToken();
+        $token = ($logon = $this->restoreLogon())->getToken();
         $request = $request->withHeader('Authorization', "Bearer $token");
         $response = $this->sendRequest($request);
 
         if ($response->getStatusCode() === 401 && $retryOn401) {
-            $this->refreshLogon();
+            $this->refreshLogon($logon);
             return $this->sendAuthenticatedRequest($request, false);
         }
 
-- 
GitLab