Skip to content

Commit ab73754

Browse files
committed
Removed 1 redirect and added loader on storefront login page in LoginAsCustomer
1 parent 14ee467 commit ab73754

File tree

4 files changed

+6
-48
lines changed

4 files changed

+6
-48
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ public function execute(): ResultInterface
127127
$this->messageManager->addSuccessMessage(
128128
__('You are logged in as customer: %1', $customer->getFirstname() . ' ' . $customer->getLastname())
129129
);
130-
$resultRedirect->setPath('*/*/proceed');
130+
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
131+
$resultPage->getConfig()->getTitle()->set(__('You are logged in'));
132+
return $this->resultFactory->create(ResultFactory::TYPE_PAGE);
131133

132134
} catch (LocalizedException $e) {
133135
$this->messageManager->addErrorMessage($e->getMessage());

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

Lines changed: 0 additions & 46 deletions
This file was deleted.

app/code/Magento/LoginAsCustomerUi/view/frontend/web/js/login.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
*/
55

66
define([
7+
'jquery',
78
'Magento_Customer/js/customer-data',
89
'Magento_Customer/js/section-config'
9-
], function (customerData, sectionConfig) {
10+
], function ($, customerData, sectionConfig) {
1011

1112
'use strict';
1213

1314
return function (config) {
15+
$('body').trigger('processStart');
1416
customerData.reload(sectionConfig.getSectionNames()).done(function () {
1517
window.location.href = config.redirectUrl;
1618
});

0 commit comments

Comments
 (0)