Browse Source

fix tenancyCurrent

Espinoza Guillermo 7 năm trước cách đây
mục cha
commit
a3ed703172
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      Security/Firewall/OAuthProxyListener.php

+ 4 - 2
Security/Firewall/OAuthProxyListener.php

@@ -213,7 +213,7 @@ class OAuthProxyListener implements ListenerInterface
 
         if(isset($filter['tenancyId']) && $filter['tenancyId'] != 1) {
             $tenancy = array(
-                array('id' => 1,'name' => 'Tenencia Base',), 
+                array('id' => 1,'name' => 'Tenencia Base',),
                 array('id' => (int) $filter['tenancyId'], 'name' => 'Tenancy Fix'));
         } else {
             $tenancy = array(array(
@@ -222,7 +222,9 @@ class OAuthProxyListener implements ListenerInterface
             ));
         }
 
-        $auth_info['tenancies'] = $auth_info['tenancyCurrent'] = $tenancy;
+        $auth_info['tenancies'] = $tenancy;
+        $auth_info['tenancyCurrent'] = end($tenancy);
+
         return $this->createCustomOAuthUser($username, $accessToken, $auth_info);
     }
 }