diff --git a/vendor/hybridauth/hybridauth/src/Provider/Apple.php b/app/code/Yeboyebo/SocialLogin/Adapter/Apple.php
index f683d6517..44218b37f 100644
--- a/vendor/hybridauth/hybridauth/src/Provider/Apple.php
+++ b/app/code/Yeboyebo/SocialLogin/Adapter/Apple.php
@@ -20,8 +20,8 @@ use Hybridauth\Adapter\OAuth2;
 use Hybridauth\Data;
 use Hybridauth\User;
 
-use phpseclib3\Crypt\PublicKeyLoader;
-use phpseclib3\Math\BigInteger;
+use phpseclib\Crypt\RSA;
+use phpseclib\Math\BigInteger;
 
 use Firebase\JWT\JWT;
 use Firebase\JWT\Key;
@@ -118,7 +118,7 @@ class Apple extends OAuth2
      * @throws InvalidApplicationCredentialsException
      */
     protected function configure()
-    {
+    {        
         $keys = $this->config->get('keys');
         $keys['secret'] = $this->getSecret();
         $this->config->set('keys', $keys);
@@ -153,6 +153,53 @@ class Apple extends OAuth2
         return $tokens;
     }
 
+     /**
+     * {@inheritdoc}
+     */
+    protected function authenticateFinish()
+    {
+        $this->logger->debug(
+            sprintf('%s::authenticateFinish(), callback url:', get_class($this)),
+            [\Hybridauth\HttpClient\Util::getCurrentUrl(true)]
+        );
+
+        $state = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'state');
+        $code = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'code');
+
+        /**
+         * Authorization Request State
+         *
+         * RFC6749: state : RECOMMENDED. An opaque value used by the client to maintain
+         * state between the request and callback. The authorization server includes
+         * this value when redirecting the user-agent back to the client.
+         *
+         * http://tools.ietf.org/html/rfc6749#section-4.1.1
+         */
+        // COMENTAMOS EL IF YA QUE STATE VIENE A NULL Y LANZA LA EXCEPCION
+        // NO AFECTA A LA AUTENTICACION YA QUE LO QUE HACE FALTA ES $code
+        // if ($this->supportRequestState && (!$state || $this->getStoredData('authorization_state') != $state)) {
+        //     $this->deleteStoredData('authorization_state');
+        //     throw new InvalidAuthorizationStateException(
+        //         'The authorization state [state=' . substr(htmlentities($state), 0, 100) . '] '
+        //         . 'of this page is either invalid or has already been consumed.'
+        //     );
+        // }
+
+        /**
+         * Authorization Request Code
+         *
+         * RFC6749: If the resource owner grants the access request, the authorization
+         * server issues an authorization code and delivers it to the client:
+         *
+         * http://tools.ietf.org/html/rfc6749#section-4.1.2
+         */
+        $response = $this->exchangeCodeForAccessToken($code);
+
+        $this->validateAccessTokenExchange($response);
+
+        $this->initialize();
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -198,18 +245,16 @@ class Apple extends OAuth2
 
             foreach ($publicKeys->keys as $publicKey) {
                 try {
+                    $rsa = new RSA();
                     $jwk = (array)$publicKey;
 
-                    $key = PublicKeyLoader::load(
+                    $rsa->loadKey(
                         [
                             'e' => new BigInteger(base64_decode($jwk['e']), 256),
                             'n' => new BigInteger(base64_decode(strtr($jwk['n'], '-_', '+/'), true), 256)
                         ]
-                    )
-                        ->withHash('sha1')
-                        ->withMGFHash('sha1');
-
-                    $pem = (string)$key;
+                    );
+                    $pem = $rsa->getPublicKey();
 
                     $payload = (version_compare($this->getJwtVersion(), '6.2') < 0) ?
                         JWT::decode($id_token, $pem, ['RS256']) :
@@ -244,11 +289,9 @@ class Apple extends OAuth2
             $user = new Data\Collection($objUser);
             if (!$user->isEmpty()) {
                 $name = $user->get('name');
-                if (!empty($name->firstName)) {
-                    $userProfile->firstName = $name->firstName;
-                    $userProfile->lastName = $name->lastName;
-                    $userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]);
-                }
+                $userProfile->firstName = $name->firstName;
+                $userProfile->lastName = $name->lastName;
+                $userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]);
             }
         }
 
@@ -338,4 +381,17 @@ class Apple extends OAuth2
             InstalledVersions::getVersion('firebase/php-jwt') :
             '';
     }
+
+    protected function getAuthorizeUrl($parameters = [])
+    {
+        $this->AuthorizeUrlParameters = !empty($parameters)
+            ? $parameters
+            : array_replace(
+                (array)$this->AuthorizeUrlParameters,
+                (array)$this->config->get('authorize_url_parameters')
+            );
+
+        $queryParams = http_build_query($this->AuthorizeUrlParameters, '', '&', $this->AuthorizeUrlParametersEncType);
+        return $this->authorizeUrl . '?' . $queryParams;
+    }
 }
