-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customer data not retrieved after executing a custom login controller #28428
Comments
Hi @pitbulk. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
|
HI, |
Hi. Exactly same problem here |
@vzabaznov any help? |
I also tried by adding ` $this->eventManager->dispatch('customer_data_object_login', ['customer' => $customer]); which are in /vendor/magento/module-customer/Model/AccountManagement.php:authenticate but there was no difference. |
@Seppo-Konttinen-Solteq This is a very simple module with the basics: If we can fix it, we can later port to any sso module. I was reviewing the login-as-customer module since it is kinda similar situation, not using the standard login. I see it already had which had a similar issue |
@pitbulk The section may be updated only by POST or PUT form submitting or AJAX request,you action |
@n1cehua1991 Thanks for replying. The custom login controller of the example module is right now a GET, but will update it to be a POST. |
@n1cehua1991 I updated the Custom Login controller to be processed as a POST, but the issue continues. The Private content doc mentions to create a sections.xml but not working. I made the custom login controller similar to Customer/Controller/Account/LoginPost.php, but not working. Can you provide a fix to my custom login module to solve the customer_data issue? |
As a temporary workaround, I created a custom block that invalidates any sections that have no entry in mage-cache-storage, so they are automatically loaded:
Put this in a phtml, include it in the default.xml of the Magento_Customer module using the Magento\Customer\Block\SectionConfig as block class and you should be all set. |
I've tried it but it doens't works.... |
I confirm Magento 2.4 also experience this issue. |
Hi @pitbulk. Thank you for your report.
The fix will be available with the upcoming 2.4.2 release. |
Glad to see it fixed. I wonder if 2.3.5.X branch could be fixed as well. |
Description
I customized the routes for login flow because I have a SAML SSO extension,
I'm experiencing issues the first time I try to log the user in using the SSO flow. Customer data is not loaded.
Preconditions
My login controller is similar than the PostLogin code
The extension also forces sections to be invalidated after my custom login, by adding a etc/frontend/sections.xml as documented on page-caching
Steps to reproduce
I implemented this simple custom login controller that will allow reproduce the issue:
https://github.com/pitbulk/magento-custom-login
If in a private browser I log in, the call to retrieve sections info does not contain the customer section.
If I later log in using the normal login process and then logout and try to log again using the SSO module, the customer data is properly retrieved.
If I analyze the call done to retrieve the customer-data, it contains the customer section:
It seems that the normal login flow set something the first time the user tries to log that is not set by my extension.
The issue I experience is similar than the one described at:
#21548
The issue exists on Magento 2.3.4, 2.3.4-p2 and 2.3.5-p1
Expected result
customer section listed on section_data_ids.
Customer data available.
Actual result
After enabling a private browser, login and logout using the SAML SSO flow, my sessions looks like:
After enabling a private browser, login and logout using the normal flow, that allows me later to login with no issue via SAML, the sessions look like:
I removed the mage-cache-storage and tried to login with SAML, and it worked, so it seems that
all that is required is to include the so it seems that once customer section customer on section_data_ids. I executed again the SAML SSO process and added the customer string manually inside the section_data_ids, so logged in, logged out, edited the Cookie and the process worked.
What may I do to include "customer" inside the section_data_ids?
The text was updated successfully, but these errors were encountered: