Skip to content

Commit 8442673

Browse files
committed
Merge branch 'module-login-as-customer' of github.com:magento/magento2-login-as-customer into module-login-as-customer
2 parents fbd1698 + 7b56529 commit 8442673

File tree

13 files changed

+132
-101
lines changed

13 files changed

+132
-101
lines changed

app/code/Magento/LoginAsCustomer/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"php": "~7.1.3||~7.2.0||~7.3.0",
66
"magento/framework": "*",
77
"magento/module-customer": "*",
8-
"magento/module-login-as-customer-api": "*",
9-
"magento/module-store": "*"
8+
"magento/module-login-as-customer-api": "*"
109
},
1110
"type": "magento2-module",
1211
"license": [

app/code/Magento/LoginAsCustomer/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<general>
1313
<enabled>0</enabled>
1414
<store_view_manual_choice_enabled>0</store_view_manual_choice_enabled>
15-
<secrets_expiration_time>60</secrets_expiration_time>
15+
<authentication_data_expiration_time>60</authentication_data_expiration_time>
1616
</general>
1717
</login_as_customer>
1818
</default>

app/code/Magento/LoginAsCustomerApi/Api/ConfigInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function isEnabled(): bool;
2929
public function isStoreManualChoiceEnabled(): bool;
3030

3131
/**
32-
* Gte authentication data expiration time (in seconds)
32+
* Get authentication data expiration time (in seconds)
3333
*
3434
* @return int
3535
*/

app/code/Magento/LoginAsCustomerLog/composer.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
"require": {
55
"php": "~7.1.3||~7.2.0||~7.3.0",
66
"magento/framework": "*",
7-
"magento/module-login-as-customer-api": "*",
8-
"magento/module-backend": "*",
9-
"magento/module-customer": "*",
10-
"magento/module-sales": "*",
11-
"magento/module-store": "*",
12-
"magento/module-ui": "*",
13-
"magento/module-user": "*"
7+
"magento/module-backend": "*"
148
},
159
"suggest": {
1610
"magento/module-login-as-customer": "*"

app/code/Magento/LoginAsCustomerSales/Plugin/AuthenticateCustomerPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function beforeExecute(
7979
* Mark customer cart as not-guest
8080
*
8181
* @param AuthenticateCustomerInterface $subject
82-
* @param null $result
82+
* @param void $result
8383
* @param AuthenticationDataInterface $authenticationData
8484
* @return void
8585
* @throws LocalizedException

app/code/Magento/LoginAsCustomerSales/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"magento/module-checkout": "*",
99
"magento/module-customer": "*",
1010
"magento/module-quote": "*",
11-
"magento/module-login-as-customer": "*",
1211
"magento/module-user": "*"
1312
},
1413
"suggest": {

app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login/Login.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
use Magento\Backend\App\Action;
1111
use Magento\Backend\App\Action\Context;
1212
use Magento\Backend\Model\Auth\Session;
13+
use Magento\Customer\Api\CustomerRepositoryInterface;
14+
use Magento\Framework\App\Action\HttpGetActionInterface;
15+
use Magento\Framework\App\Action\HttpPostActionInterface;
1316
use Magento\Framework\Controller\Result\Redirect;
1417
use Magento\Framework\Controller\ResultFactory;
1518
use Magento\Framework\Controller\ResultInterface;
16-
use Magento\Framework\App\Action\HttpGetActionInterface;
17-
use Magento\Framework\App\Action\HttpPostActionInterface;
18-
use Magento\Customer\Api\CustomerRepositoryInterface;
1919
use Magento\Framework\Exception\LocalizedException;
2020
use Magento\Framework\Exception\NoSuchEntityException;
21+
use Magento\Framework\Url;
2122
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
2223
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface;
2324
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterfaceFactory;
@@ -69,14 +70,20 @@ class Login extends Action implements HttpGetActionInterface, HttpPostActionInte
6970
*/
7071
private $saveAuthenticationData;
7172

73+
/**
74+
* @var Url
75+
*/
76+
private $url;
77+
7278
/**
7379
* @param Context $context
7480
* @param Session $authSession
7581
* @param StoreManagerInterface $storeManager
7682
* @param CustomerRepositoryInterface $customerRepository
7783
* @param ConfigInterface $config
7884
* @param AuthenticationDataInterfaceFactory $authenticationDataFactory
79-
* @param SaveAuthenticationDataInterface $saveAuthenticationData
85+
* @param SaveAuthenticationDataInterface $saveAuthenticationData ,
86+
* @param Url $url
8087
*/
8188
public function __construct(
8289
Context $context,
@@ -85,7 +92,8 @@ public function __construct(
8592
CustomerRepositoryInterface $customerRepository,
8693
ConfigInterface $config,
8794
AuthenticationDataInterfaceFactory $authenticationDataFactory,
88-
SaveAuthenticationDataInterface $saveAuthenticationData
95+
SaveAuthenticationDataInterface $saveAuthenticationData,
96+
Url $url
8997
) {
9098
parent::__construct($context);
9199

@@ -95,6 +103,7 @@ public function __construct(
95103
$this->config = $config;
96104
$this->authenticationDataFactory = $authenticationDataFactory;
97105
$this->saveAuthenticationData = $saveAuthenticationData;
106+
$this->url = $url;
98107
}
99108

100109
/**
@@ -165,9 +174,8 @@ private function getLoginProceedRedirectUrl(string $secret, ?int $storeId): stri
165174
$store = $this->storeManager->getStore($storeId);
166175
}
167176

168-
$redirectUrl = $this->_url
177+
return $this->url
169178
->setScope($store)
170179
->getUrl('loginascustomer/login/index', ['secret' => $secret, '_nosid' => true]);
171-
return $redirectUrl;
172180
}
173181
}

app/code/Magento/LoginAsCustomerUi/ViewModel/Configuration.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Magento\LoginAsCustomerUi\ViewModel;
99

1010
use Magento\Customer\Model\Context;
11-
use Magento\LoginAsCustomer\Model\Config;
1211
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1312

1413
/**
@@ -17,7 +16,7 @@
1716
class Configuration implements \Magento\Framework\View\Element\Block\ArgumentInterface
1817
{
1918
/**
20-
* @var Config
19+
* @var ConfigInterface
2120
*/
2221
private $config;
2322

app/code/Magento/LoginAsCustomerUi/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"magento/module-backend": "*",
99
"magento/module-customer": "*",
1010
"magento/module-store": "*",
11-
"magento/module-ui": "*",
12-
"magento/module-user": "*"
11+
"magento/module-ui": "*"
1312
},
1413
"suggest": {
1514
"magento/module-login-as-customer": "*"

app/code/Magento/LoginAsCustomerUi/etc/adminhtml/system.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
99
<system>
10-
<section id="loginascustomer" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
10+
<section id="login_as_customer" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
1111
<class>separator-top</class>
1212
<label>Login As Customer</label>
1313
<tab>customer</tab>
@@ -18,7 +18,7 @@
1818
<label>Enable Extension</label>
1919
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
2020
</field>
21-
<field id="enable_store_view_manual_choice" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
21+
<field id="store_view_manual_choice_enabled" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
2222
<label>Store View To Login In</label>
2323
<source_model>Magento\LoginAsCustomerUi\Model\Config\Source\StoreViewLogin</source_model>
2424
<comment><![CDATA[

0 commit comments

Comments
 (0)