markitosgv/JWTRefreshTokenBundle

Setting cookie same_site with env variable not possible

Opened this issue · 3 comments

Retch commented

I can't set the same_site via environment variable, but the other settings are working.
gesdinet_jwt_refresh_token.yaml
image
.env
image
php bin/console debug:container --env-vars
image
This is working ⬆️

But when i use a var for same site ⬇️
image
image
image
How is it possible to accomplish this?

TBH, I don't know if Symfony itself supports env vars in config nodes that are defined as an enum (fixed list, not the PHP core enum), that error's coming from the config component's validation step. That said, even if it's accepting env vars for other values in the cookie config, since that config's not being post-processed in any way, I'm not so sure it's actually pushing resolved values through to the services (you might need to dump the gesdinet_jwt_refresh_token.cookie container parameter or check into what values are actually being pushed into the gesdinet.jwtrefreshtoken.send_token service to make sure it's actually getting the right info).

Payn commented

@Retch did you resolve this issue somehow?

Symfony fixed ENV in enum config nodes long ago for this exact same usecase symfony/symfony#45624 but not sure if it even works for their config.

Trying to debug it, looks like placeholders are not resolved in EnumNode - self::$placeholders contains only empty strings for all ENV variables.

@Payn i don't really know anymore. Maybe i should have a look in the project again and tell you.