LocaleBundle icon indicating copy to clipboard operation
LocaleBundle copied to clipboard

Token is null when onLocaleChange is dispatched

Open maks-rafalko opened this issue 11 years ago • 2 comments

Hi,

when onLocaleChange is dispatched, there is no yet token

$securityContext->getToken(); // returns null

So it's impossible to subscribe to this event to update locale column in users table.

I see that this event was dispatched in LocaleController before. What is the reason of removing it? How to update user entity each time locale is changed?

maks-rafalko avatar Nov 29 '14 13:11 maks-rafalko

ping...

vlastv avatar May 28 '15 15:05 vlastv

Hi, I'm also trying to listen to that event, and indeed security token is null. any idea why ? working with symfony 2.6/2.7, tried with deprecated security.context and security.token_storage.

jmeyo avatar Jun 05 '15 11:06 jmeyo