You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On /checkout/confirm notice that your email address is wrong
Click browser back button
Change email in form
Submit
Expected behaviour:
A new guest account/session is created with the newly entered email and the customer is again on /checkout/confirm
Actual behaviour:
A redirect loop occurs
Possible Solution
My proposed solution to break this cycle would be to change the first check in \Shopware\Storefront\Controller\RegisterController::register as follows:
if ($context->getCustomer() && !$context->getCustomer()->getGuest()) {
return$this->redirectToRoute('frontend.account.home.page');
}
A more detailed look into the handling of the various steps with regards to guest account handling couldn't hurt though.
Additional context
The redirect is triggered in \Shopware\Storefront\Controller\RegisterController::register, where if ($context->getCustomer()) leads to a redirect to frontend.account.home.page regardless of whether it's a guest account or not. \Shopware\Storefront\Controller\AccountProfileController::index(the target action) however starts with $this->denyAccessUnlessLoggedIn(); (default parameter $allowGuest = false), which redirects to the Login page, but \Shopware\Storefront\Controller\AuthController::loginPage again only checks for if ($context->getCustomer()) and redirects back to the account page - the endless loop begins. (The redirectTo parameter of the login page is set to the account page when the \Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException is handled in \Shopware\Storefront\Framework\Routing\StorefrontSubscriber::customerNotLoggedInHandler)
The text was updated successfully, but these errors were encountered:
Hey @lars-feyerabend, thank you for reporting this, and sorry for the late response.
I'm closing this issue, as this landed in our triage and we can not reproduce this on current shopware release.
Description
Steps to reproduce:
Expected behaviour:
Actual behaviour:
Possible Solution
My proposed solution to break this cycle would be to change the first check in
\Shopware\Storefront\Controller\RegisterController::register
as follows:A more detailed look into the handling of the various steps with regards to guest account handling couldn't hurt though.
Additional context
The redirect is triggered in
\Shopware\Storefront\Controller\RegisterController::register
, whereif ($context->getCustomer())
leads to a redirect tofrontend.account.home.page
regardless of whether it's a guest account or not.\Shopware\Storefront\Controller\AccountProfileController::index
(the target action) however starts with$this->denyAccessUnlessLoggedIn();
(default parameter$allowGuest = false
), which redirects to the Login page, but\Shopware\Storefront\Controller\AuthController::loginPage
again only checks forif ($context->getCustomer())
and redirects back to the account page - the endless loop begins. (The redirectTo parameter of the login page is set to the account page when the\Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException
is handled in\Shopware\Storefront\Framework\Routing\StorefrontSubscriber::customerNotLoggedInHandler
)The text was updated successfully, but these errors were encountered: