浏览代码

security update

Olivier Massot 3 年之前
父节点
当前提交
d262516e1c
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      ot_connect/Classes/Service/OtAuthenticationService.php

+ 6 - 1
ot_connect/Classes/Service/OtAuthenticationService.php

@@ -112,7 +112,7 @@ class OtAuthenticationService extends AbstractAuthenticationService
         // Does the user already have a session on the Opentalent API?
         $username = $this->getAuthenticatedUsername();
 
-        if ($username != null && $this->authInfo['loginType'] == 'FE' && $this->login['status'] === 'logout') {
+        if ($username != null && $this->authInfo['loginType'] === 'FE' && $this->login['status'] === 'logout') {
             // This is a logout request
             $this->logout();
             return false;
@@ -140,6 +140,11 @@ class OtAuthenticationService extends AbstractAuthenticationService
             }
         }
 
+        /// At this point, username should be set
+        if ($username === null) {
+            return false;
+        }
+
         // Request the latest data for the user and write it in the Typo3 DB
         //   * The shouldUserBeUpdated() method checks if the user was already
         //   generated in the last minutes, to avoid unnecessary operations *