I was wondering if there is away to call a function after the user login.
Here is the code I want to call:
$point = $this->container->get('process_points');
$point->ProcessPoints(1 , $this->container);
I was wondering if there is away to call a function after the user login.
Here is the code I want to call:
$point = $this->container->get('process_points');
$point->ProcessPoints(1 , $this->container);
You can find the events FOSUserBundle fires in the FOSUserEvents class. More specifically, this is the one you are looking for:
The documentation for hooking into those events can be found on the Hooking into the controllers doc page. In your case, you will need to implement something like this:
You should then define the listener as a service and inject the container. Alternatively, you could inject just the service you need instead of the whole container.
There is also another method which involves overriding the controller, but as noted in the documentation, you have to duplicate their code so it's not exactly clean and bound to break if (or rather, when) FOSUserBundle is changed.