Closed ananth-iyer closed 5 months ago
Hi @ananth-iyer. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento give me 2.4-develop instance
Hi @ananth-iyer. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @ananth-iyer, here is your Magento Instance: https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering Admin access: https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering/admin_b432 Login: 3eb31f53 Password: 06218ec6c308
If you visit this link: https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering/customer/account/loginPost/ Click on Sign In on above link so will get better idea
Hi @ananth-iyer
Thanks for your contribution and collaboration.
I have tried to reproduce the issue but unable to reproduce it. Kindly refer this video for your reference.Also, update your steps to reproduce if something you have missed in it. If possible please send video of this issue.It will be helpful to us.
Thanks
You did not click this link to replicate the issue - https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering/customer/account/loginPost/
It is clear, you don't want to fix the issue.
@engcom-Lima ☝🏻
@magento give me 2.4-develop instance
Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Lima, here is your Magento Instance: https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering Admin access: https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering/admin_3dc3 Login: ac208836 Password: 2adf4dfe1963
Hi @ananth-iyer ,
I had clicked on above url you have given and I got the 404 error as you described. Further I tried to investigate when we get this url appended with /loginPost
.
Inorder to identify the specific scenario I had followed your steps to reproduce and recorded above video.
Can you please help answering whether you are updating url your own or any specific scenario we have to follow to get the url appended with /loginPost
?
Thanks
@engcom-Lima It takes referer url /loginPost
, encodes with base64 and adds in referer parameter of /login
. So after success login, page is redirected to /loginPost
@magento give me 2.4-develop instance
Hi @ananth-iyer. Thank you for your request. I'm working on Magento instance for you.
Hi @ananth-iyer, here is your Magento Instance: https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering Admin access: https://70b0711c568e9cdf00416449ee01f393.instances.magento-community.engineering/admin_0ec3 Login: 89da8442 Password: 217a3ecdd1fa
@engcom-Lima check this screen recording Untitled_ Jul 29, 2022 3_00 PM.webm
:heavy_check_mark: Issue confirmed
Issue got reproduced in 2.4-develop branch.
Description: Customer is logged in but showing 404 error in the frontend.
Pre-requisite:
Fresh magento 2.4-develop
should be installed.
Steps to reproduce:
/customer/account/loginPost/
in your magento url.Expected result: It should generate referrer url to Customer dashboard page when referer URL header contains /loginPost.
Actual result: It is not generating referrer url to customer dashboard page,It is showing 404 error page but customer is logged in.
Screenshots:
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6071 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Lima. Thank you for verifying the issue.
Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @engcom-Lima are there any updates?
I have the same issue, its also compounded by Amasty plugin redirecting all 404 pages to search making it confusing as hell.
This is still present on 2.4.5 upgrade from 2.4.3.
I think what happens is that after an unsuccesful login, it loses referrer URL or something similar happens and it just dumps the user to 404 page.
Hi @pmonosolo & @ananth-iyer ,
Thanks for your contribution and collaboration.
Internal team is working on it ,we will come back soon with some result.
Thanks
Hi @pmonosolo & @ananth-iyer ,
Thanks for your contribution and collaboration.
Internal team is working on it ,we will come back soon with some result.
Thanks
Thanks @engcom-Lima !
It'd be great if the fix was released as a hotfix instead of waiting for a full release or a patch.
We cant have enterprise software have a serious issue where we lose customers because the basic function such as login does not work.
We faced a similar issue in our one of the commerce cloud websites and the Adobe support team is not ready to check this so I am also actively looking for a solution.
In our case, the referer URL is incorrectly generated, and due to that customer is not redirecting to the previous page after login.
The issue is the login referer URL miss %2C at the end of the URL. Correct URL: https://www.our_domain.com/en/customer/account/login/referer/aHR0cHM6Ly93d3cucGFjaWZpY3Ntb2tlLmNvbS9lbi8%2C%2C/
As you can see, the correct URL has %2C at the end, which is missing in the wrong URL. (Basically, correct URL has two %2C%2C but the wrong URL only has one)
If we manually add %2C at the end of the URL, then it works as expected.
Now we are not sure why %2C is missing from the URL.
And the best thing is if we cloned the commerce cloud website to local (with same code and DB) then we have not face any issue :(
Thanks, Vish
@engcom-Lima are there any updates?
It happens everywhere where you have an exception during login.
For example, you created a new customer account but did not verify the customer's email. Try to log in and you will get the link with the referer param. Then verify the customer email and finish login using the link with the referer param.
Main bug in the file vendor/magento/module-customer/Model/Url.php, function getLoginUrlParams
It makes referer using urlBuilder from
$referer = $this->urlBuilder->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);
but due to an exception, it generates to own controller: customer/account/loginPost
Quick solution until Magento developers make the right fix:
use Magento\Framework\Url\DecoderInterface; use Magento\Framework\Url\EncoderInterface; use Magento\Framework\UrlInterface;
/**
* Fix Magento bug with customer logged in 404 referer url
* https://github.com/magento/magento2/issues/35838
*
* @param \Magento\Customer\Model\Url $subject
* @param $result
* @return mixed
*/
public function afterGetLoginUrlParams(
\Magento\Customer\Model\Url $subject,
$result
) {
if(isset($result[\Magento\Customer\Model\Url::REFERER_QUERY_PARAM_NAME])){
$referer = $result[\Magento\Customer\Model\Url::REFERER_QUERY_PARAM_NAME];
$refererUrl = $this->urlDecoder->decode($referer);
if(strpos($refererUrl, 'customer/account/loginPost')){
$newReferer = $this->urlBuilder->getUrl('customer/account/index', ['_current' => true, '_use_rewrite' => true]);
$result[\Magento\Customer\Model\Url::REFERER_QUERY_PARAM_NAME] = $this->urlEncoder->encode($newReferer);
}
}
return $result;
}
Preconditions and environment
Base64 - aHR0cDovL21hZ2VudG8yNDAubG9jYWwvY3VzdG9tZXIvYWNjb3VudC9sb2dpblBvc3Qv Decoded Base64 - http://magento240.local/customer/account/loginPost/
Steps to reproduce
/customer/account/loginPost/
in your magento url. ex-http://magento240.local/customer/account/loginPost/Expected result
It should generate referer url to Customer dashboard page when referer URL header contains /loginPost.
Actual result
It is not generating referrer url to customer dashboard page,It is showing 404 error page but customer is logged in.
Attached video: Untitled_ Jul 29, 2022 3_00 PM.webm
Additional information
No response
Release note
No response
Triage and priority