Skip to content

Commit e4454b4

Browse files
committed
ACP2E-320:Fixed Content Staging Preview Login Issue.
ACP2E-320:Fixed Content Staging Preview Login Issue. ACP2E-320: Fixed Static Test ACP2E-320:Fixed Content Staging Preview Login Issue.
1 parent f56e1d0 commit e4454b4

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

app/code/Magento/Customer/Block/Account/AuthenticationPopup.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function __construct(
4242
}
4343

4444
/**
45+
* Returns serialize jsLayout
46+
*
4547
* @return string
4648
*/
4749
public function getJsLayout()
@@ -60,7 +62,8 @@ public function getConfig()
6062
'autocomplete' => $this->escapeHtml($this->isAutocompleteEnabled()),
6163
'customerRegisterUrl' => $this->escapeUrl($this->getCustomerRegisterUrlUrl()),
6264
'customerForgotPasswordUrl' => $this->escapeUrl($this->getCustomerForgotPasswordUrl()),
63-
'baseUrl' => $this->escapeUrl($this->getBaseUrl())
65+
'baseUrl' => $this->escapeUrl($this->getBaseUrl()),
66+
'customerLoginUrl'=> $this->getUrl('customer/ajax/login'),
6467
];
6568
}
6669

app/code/Magento/Customer/Test/Unit/Block/Account/AuthenticationPopupTest.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function ($string) {
102102
*
103103
* @dataProvider dataProviderGetConfig
104104
*/
105-
public function testGetConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUrl, array $result)
105+
public function testGetConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUrl, $loginUrl, array $result)
106106
{
107107
$this->scopeConfigMock->expects($this->any())
108108
->method('getValue')
@@ -129,6 +129,7 @@ public function testGetConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUr
129129
[
130130
['customer/account/create', [], $registerUrl],
131131
['customer/account/forgotpassword', [], $forgotUrl],
132+
['customer/ajax/login', [], $loginUrl],
132133
]
133134
);
134135

@@ -146,47 +147,55 @@ public function dataProviderGetConfig()
146147
'base',
147148
'reg',
148149
'forgot',
150+
'loginUrl',
149151
[
150152
'autocomplete' => 'escapeHtmloff',
151153
'customerRegisterUrl' => 'escapeUrlreg',
152154
'customerForgotPasswordUrl' => 'escapeUrlforgot',
153155
'baseUrl' => 'escapeUrlbase',
156+
'customerLoginUrl'=>'loginUrl',
154157
],
155158
],
156159
[
157160
1,
158161
'',
159162
'reg',
160163
'forgot',
164+
'loginUrl',
161165
[
162166
'autocomplete' => 'escapeHtmlon',
163167
'customerRegisterUrl' => 'escapeUrlreg',
164168
'customerForgotPasswordUrl' => 'escapeUrlforgot',
165169
'baseUrl' => 'escapeUrl',
170+
'customerLoginUrl'=>'loginUrl',
166171
],
167172
],
168173
[
169174
'',
170175
'base',
171176
'',
172177
'forgot',
178+
'loginUrl',
173179
[
174180
'autocomplete' => 'escapeHtmloff',
175181
'customerRegisterUrl' => 'escapeUrl',
176182
'customerForgotPasswordUrl' => 'escapeUrlforgot',
177183
'baseUrl' => 'escapeUrlbase',
184+
'customerLoginUrl'=>'loginUrl',
178185
],
179186
],
180187
[
181188
true,
182189
'base',
183190
'reg',
184191
'',
192+
'loginUrl',
185193
[
186194
'autocomplete' => 'escapeHtmlon',
187195
'customerRegisterUrl' => 'escapeUrlreg',
188196
'customerForgotPasswordUrl' => 'escapeUrl',
189197
'baseUrl' => 'escapeUrlbase',
198+
'customerLoginUrl'=>'loginUrl',
190199
],
191200
],
192201
];
@@ -202,8 +211,14 @@ public function dataProviderGetConfig()
202211
*
203212
* @dataProvider dataProviderGetConfig
204213
*/
205-
public function testGetSerializedConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUrl, array $result)
206-
{
214+
public function testGetSerializedConfig(
215+
$isAutocomplete,
216+
$baseUrl,
217+
$registerUrl,
218+
$forgotUrl,
219+
$loginUrl,
220+
array $result
221+
) {
207222
$this->scopeConfigMock->expects($this->any())
208223
->method('getValue')
209224
->with(Form::XML_PATH_ENABLE_AUTOCOMPLETE, ScopeInterface::SCOPE_STORE, null)
@@ -229,6 +244,7 @@ public function testGetSerializedConfig($isAutocomplete, $baseUrl, $registerUrl,
229244
[
230245
['customer/account/create', [], $registerUrl],
231246
['customer/account/forgotpassword', [], $forgotUrl],
247+
['customer/ajax/login', [], $loginUrl],
232248
]
233249
);
234250
$this->serializerMock->expects($this->any())->method('serialize')

app/code/Magento/Customer/view/frontend/web/js/action/login.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ define([
2222
*/
2323
action = function (loginData, redirectUrl, isGlobal, messageContainer) {
2424
messageContainer = messageContainer || globalMessageList;
25+
let customerLoginUrl = 'customer/ajax/login';
26+
27+
if(window.authenticationPopup.customerLoginUrl) {
28+
customerLoginUrl = window.authenticationPopup.customerLoginUrl;
29+
}
2530

2631
return storage.post(
27-
'customer/ajax/login',
32+
customerLoginUrl,
2833
JSON.stringify(loginData),
2934
isGlobal
3035
).done(function (response) {

0 commit comments

Comments
 (0)