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

SalesChannelRequestContextResolver does not resolve logged user after xhr request #3010

Open
harli91 opened this issue Mar 13, 2023 · 1 comment
Labels

Comments

@harli91
Copy link

harli91 commented Mar 13, 2023

PHP Version

8.1

Shopware Version

v6.5rc1

Expected behaviour

When doing a xhr request to log in a customer using:

$context = $this->restorer->restoreByCustomer($customer->getId(), $this->salesChannelContext->getContext());
        $this->eventDispatcher->dispatch(
            new CustomerLoginEvent($context, $customer, $context->getToken())
);

after the customer is logged in, you refresh the page and the customer is logged in, $salesChannelContext->getCustomer() is not null

Actual behaviour

Customer is not logged in, $salesChannelContext->getCustomer() is null

How to reproduce

Create a route that returns json, execute the code above in that route, go back to front page, check the user menu for a successful login

Tasks

No tasks being tracked yet.
@harli91 harli91 added the Bug label Mar 13, 2023
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