lunetics-org/LocaleBundle

Token is null when onLocaleChange is dispatched

Opened this issue · 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?

ping...

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.