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

How to autowire cookieProvider dynamically (without cookie name)? #1189

Open
bhalexx opened this issue Dec 29, 2023 · 1 comment
Open

How to autowire cookieProvider dynamically (without cookie name)? #1189

bhalexx opened this issue Dec 29, 2023 · 1 comment

Comments

@bhalexx
Copy link

bhalexx commented Dec 29, 2023

Hi,

We recently needed to add another way to login to another part of our application with an autologin link.
We add the cookie to the response in the AuthenticationSuccessHandler::onAuthenticationSuccess method:

$response->headers->setCookie($this->cookieProvider->createCookie($this->JWTManager->create($token->getUser())));

I tried many ways to dynamically autowire JWTCookieProvider but nothing worked and I still have to inject it with the cookie name. Is there a way to autowire JWTCookieProvider(s) without giving cookie name or by giving it from .env ? If not, wouldn't it be useful? :)

@maxhelias
Copy link
Contributor

We'll need to create a cookie chained provider service rather than using an iterable and we can easily do that

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

No branches or pull requests

2 participants