Skip to content
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

Regression - Can't login if sales domain has custom paths - Unable to find a matching sales channel for the request #3685

Open
matheusgontijo opened this issue Apr 24, 2024 · 2 comments
Labels

Comments

@matheusgontijo
Copy link
Contributor

PHP Version

8.3

Shopware Version

6.6.1.1

Expected behaviour

Login

Actual behaviour

Can't login. Reason: custom path on sales domain.

How to reproduce

Apparently I found out a bug the request forwards. It's a regression, as it used to work before.

I'm currently on Shopware 6.6.1.1, but I believe it's ocurring in previous versions as well.

Let's say that I have the following sales domains:

http://mycustomdomain.com/en
http://mycustomdomain.com/de
http://mycustomdomain.com/it

Then I go to login page of my domains.

http://mycustomdomain.com/en/account/login
http://mycustomdomain.com/de/account/login
http://mycustomdomain.com/it/account/login

So far so good. The pages renders perfectly.

But when I fulfill the login and password fields and hit "Log in" button, the browser sends a POST request and I will get the following error:

Unable to find a matching sales channel for the request: "http://mycustomdomain.com/account/login". Please make sure the domain mapping is correct.

The problem is that Shopware is removing the custom paths of my domain (en, de, it) to match controllers, in this case "/account/login". See: https://github.com/shopware/shopware/blob/trunk/src/Storefront/Framework/Routing/RequestTransformer.php#L99-L215

However, internally Shopware creates a "custom" request object, removing the en, de, it custom paths, which will not work for subsequent forwards. On the subquent subrequests pathInfo shouldn't be /account/login but it should actually following the main request such as:

/en/account/login
/de/account/login
/it/account/login

Apparently, Shopware team knows the issue, but it's a big regression in such important feature... For example: we can't simply login on the Shopware 6.6.1.1 if we have custom paths.

See: https://github.com/shopware/shopware/blob/trunk/src/Storefront/Framework/Routing/RequestTransformer.php#L109-L110

👉👉 Is there anything that we could do about in order to login?

Thank you so much for your time and assistance.

@matheusgontijo
Copy link
Contributor Author

Just found the same request here:

https://issues.shopware.com/issues/NEXT-35237

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant