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

[FrameworkBundle] fix KernelBrowser::loginUser with a stateless firewall #41505

Merged
merged 1 commit into from Jun 3, 2021

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Jun 1, 2021

Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets n/a
License MIT
Doc PR todo?

Currently, KernelBrowser::loginUser() doesn't work with stateless firewalls (Basic HTTP, JWT etc) and fails if the session is disabled (which is frequent when creating web APIs, and when using stateless firewalls). This PR fixes the problem.

@nicolas-grekas
Copy link
Member

Thank you @dunglas.

@nicolas-grekas nicolas-grekas merged commit 26a6468 into symfony:5.2 Jun 3, 2021
$session = $this->getContainer()->get('session');

$container = $this->getContainer();
$container->get('security.token_storage')->setToken($token);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced by security.untracked_token_storage in b004f3b

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops sorry I totally forgot about the existence of this service. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

5 participants