瀏覽代碼

gitflow-hotfix-stash: V8-4247_no_auth_request_on_missing_cookie

Olivier Massot 2 年之前
父節點
當前提交
d4fc7fab1e
共有 1 個文件被更改,包括 5 次插入0 次删除
  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) {