Ver Fonte

gitflow-hotfix-stash: V8-4247_no_auth_request_on_missing_cookie

Olivier Massot há 2 anos atrás
pai
commit
d4fc7fab1e
1 ficheiros alterados com 5 adições e 0 exclusões
  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) {