Skip to content

Commit

Permalink
Merge pull request #150 from gigya/develop
Browse files Browse the repository at this point in the history
6.1.1
  • Loading branch information
Ynhockey authored Aug 15, 2023
2 parents 88d1af3 + af75c7c commit 1214c3c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
18 changes: 8 additions & 10 deletions Helper/GigyaMageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
namespace Gigya\GigyaIM\Helper;

use Exception;
use Firebase\JWT\JWT;
use Gigya\GigyaIM\Api\GigyaAccountServiceInterface;
use Gigya\GigyaIM\Helper\CmsStarterKit\GSApiException;
Expand Down Expand Up @@ -71,7 +72,6 @@ class GigyaMageHelper extends AbstractHelper
* @param GigyaLogger $logger
* @param ModuleListInterface $moduleList
* @param Config $configModel
* @param Session $session
* @param CookieManagerInterface $cookieManager
* @param SigUtils $sigUtils
* @param Encryptor $encryptor
Expand All @@ -83,7 +83,6 @@ public function __construct(
GigyaLogger $logger,
ModuleListInterface $moduleList,
Config $configModel,
Session $session,
CookieManagerInterface $cookieManager,
SigUtils $sigUtils,
Encryptor $encryptor,
Expand All @@ -96,7 +95,6 @@ public function __construct(
$this->configModel = $configModel;
$this->scopeConfig = $context->getScopeConfig();
$this->_moduleList = $moduleList;
$this->session = $session;
$this->cookieManager = $cookieManager;
$this->sigUtils = $sigUtils;
$this->encryptor = $encryptor;
Expand All @@ -106,7 +104,7 @@ public function __construct(
}

/**
* Retrive the application secret
* Retrieve the application secret
*
* @return string
*/
Expand All @@ -116,7 +114,7 @@ public function getAppSecret()
}

/**
* Retrive the application private key
* Retrieve the application private key
*
* @return string
*/
Expand Down Expand Up @@ -216,7 +214,7 @@ public function getMaxRetryCountForGigyaUpdate()
* @param $scopeCode
* @param $settings
*
* @throws \Exception
* @throws Exception
*/
public function setGigyaSettings(
$scopeType = ScopeInterface::SCOPE_WEBSITE,
Expand Down Expand Up @@ -274,7 +272,7 @@ public function getGigyaApiHelper()
try {
$authKey = ($this->authMode == 'user_rsa') ? $this->getPrivateKey() : $this->getAppSecret();
$this->gigyaApiHelper = new GigyaApiHelper($this->apiKey, $this->appKey, $authKey, $this->apiDomain, $this->dir, $this->authMode);
} catch (\Exception $e) {
} catch (Exception $e) {
return false;
}
}
Expand Down Expand Up @@ -311,7 +309,7 @@ protected function createEnvironmentParam()
* @return bool|\Gigya\GigyaIM\Helper\CmsStarterKit\user\GigyaUser
*
* @throws GSApiException
* @throws \Exception
* @throws Exception
*/
public function validateAndFetchRaasUser($uid, $signature, $signatureTimestamp)
{
Expand Down Expand Up @@ -514,13 +512,13 @@ public function getGigyaAccountDataFromLoginData($loginData)
case GigyaAccountServiceInterface::ERR_CODE_LOGIN_ID_ALREADY_EXISTS:
$this->logger->debug("Error while retrieving Gigya account data", [
'gigya_data' => $loginData,
'customer_entity_id' => ($this->session->isLoggedIn()) ? $this->session->getCustomerId() : 'not logged in'
// 'customer_entity_id' => ($this->session->isLoggedIn()) ? $this->session->getCustomerId() : 'not logged in'
]);
throw new GSException("Email already exists.");
default:
$this->logger->debug("Error while retrieving Gigya account data", [
'gigya_data' => $loginData,
'customer_entity_id' => ($this->session->isLoggedIn()) ? $this->session->getCustomerId() : 'not logged in'
// 'customer_entity_id' => ($this->session->isLoggedIn()) ? $this->session->getCustomerId() : 'not logged in'
]);
throw new GSException(sprintf("Unable to get Gigya account data : %s / %s", $gigya_validation_o->errorCode, $gigya_validation_o->errorMessage));
}
Expand Down
13 changes: 7 additions & 6 deletions Helper/GigyaSyncHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public function __construct(
FilterBuilder $filterBuilder,
FilterGroupBuilder $filterGroupBuilder,
StoreManagerInterface $storeManager,
Session $customerSession,
AppState $state,
Share $shareConfig
) {
Expand All @@ -99,7 +98,6 @@ public function __construct(
$this->filterBuilder = $filterBuilder;
$this->filterGroupBuilder = $filterGroupBuilder;
$this->storeManager = $storeManager;
$this->session = $customerSession;
$this->appState = $state;
$this->shareConfig = $shareConfig;
}
Expand Down Expand Up @@ -298,15 +296,18 @@ public function setMagentoLoggingContext($gigyaAccount)
// This value will be set with the preferred email that should be attached with the Magento customer account, among all the Gigya loginIDs emails
// We initialize it to null. If it's still null at the end of the algorithm that means that the user can not logged in
// because all Gigya loginIDs emails are already set to existing Magento customer accounts with a different or null Gigya UID
$this->session->setGigyaAccountLoggingEmail(null);
// Using Object manager in order to fix the di issue
$om = \Magento\Framework\App\ObjectManager::getInstance();
$session = $om->get('Magento\Customer\Model\Session');
$session->setGigyaAccountLoggingEmail(null);

// This will be set with the incoming $gigyaAccount parameter if the customer can be logged in on Magento.
$this->session->setGigyaAccountData(null);
$session->setGigyaAccountData(null);

$result = $this->getMagentoCustomerAndLoggingEmail($gigyaAccount);

$this->session->setGigyaAccountData($gigyaAccount);
$this->session->setGigyaAccountLoggingEmail($result['logging_email']);
$session->setGigyaAccountData($gigyaAccount);
$session->setGigyaAccountLoggingEmail($result['logging_email']);

return $result['customer'];
}
Expand Down
1 change: 0 additions & 1 deletion Helper/RetryGigyaSyncHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public function __construct(
$filterBuilder,
$filterGroupBuilder,
$storeManager,
$customerSession,
$state,
$shareConfig
);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gigya/magento2-im",
"description": "Gigya Identity Management for Magento 2",
"type": "magento2-module",
"version": "6.1.0",
"version": "6.1.1",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Gigya_GigyaIM" setup_version="6.1.0">
<module name="Gigya_GigyaIM" setup_version="6.1.1">
<sequence>
<module name="Magento_Framework"/>
<module name="Magento_Customer"/>
Expand Down

0 comments on commit 1214c3c

Please sign in to comment.