Browse Source

security update

Olivier Massot 3 năm trước cách đây
mục cha
commit
d262516e1c
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  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 *