Skip to content

Commit 66b7f8f

Browse files
committed
ACP2E-320:Remove authenticationpop dependecy
1 parent 0aee96f commit 66b7f8f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ define([
2424
messageContainer = messageContainer || globalMessageList;
2525
let customerLoginUrl = 'customer/ajax/login';
2626

27-
if (window.authenticationPopup && window.authenticationPopup.customerLoginUrl) {
28-
customerLoginUrl = window.authenticationPopup.customerLoginUrl;
27+
if (loginData.customerLoginUrl) {
28+
customerLoginUrl = loginData.customerLoginUrl;
2929
}
3030

3131
return storage.post(

app/code/Magento/Customer/view/frontend/web/js/view/authentication-popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ define([
8080
formDataArray.forEach(function (entry) {
8181
loginData[entry.name] = entry.value;
8282
});
83-
83+
loginData['customerLoginUrl'] = window.authenticationPopup.customerLoginUrl;
8484
if (formElement.validation() &&
8585
formElement.validation('isValid')
8686
) {

dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/view/authentication-popup.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ define(['squire'], function (Squire) {
3030
customerRegisterUrl: 'register_url',
3131
customerForgotPasswordUrl: 'forgot_password_url',
3232
autocomplete: 'autocomplete_flag',
33-
baseUrl: 'base_url'
33+
baseUrl: 'base_url',
34+
customerLoginUrl:'customer_login_url'
3435
};
3536

3637
injector.mock(mocks);
@@ -81,7 +82,8 @@ define(['squire'], function (Squire) {
8182

8283
expect(obj.login(null, event)).toBeFalsy();
8384
expect(mocks['Magento_Customer/js/action/login']).toHaveBeenCalledWith({
84-
username: 'customer'
85+
username: 'customer',
86+
customerLoginUrl: 'customer_login_url'
8587
});
8688
});
8789
});

0 commit comments

Comments
 (0)