Browse Source

gitflow-hotfix-stash: V8-4247_no_auth_request_on_missing_cookie

Olivier Massot 2 năm trước cách đây
mục cha
commit
d4fc7fab1e
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      ot_connect/Classes/Service/OtAuthenticationService.php

+ 5 - 0
ot_connect/Classes/Service/OtAuthenticationService.php

@@ -177,6 +177,11 @@ class OtAuthenticationService extends AbstractAuthenticationService
     {
         $this->fillCookieJar();
         try {
+            if (!$this->jar->getCookieByName('BEARER')) {
+                // Missing cookie : No need to ask API
+                return null;
+            }
+
             $response = $this->apiService->get(self::ISAUTH_URI, [], ['cookies' => $this->jar]);
 
             if ($response->getStatusCode() != 200) {