Symfony2 - Extend RememberMe Success Handler

I want to perform one small PHP action after someone just logged in with the Remember Me feature in Symfony2.

I saw this, but not sure how to extend it: http://api.symfony.com/2.3/Symfony/Component/Security/Http/RememberMe/PersistentTokenBasedRememberMeServices.html

I'm not sure how to do this (without editing the main code, which, of course, will not be good). I added my own code to the AuthenticationSuccess handler when it logs in by submitting the form, but this is just by creating a service and specifying an example as shown below, but I don’t see the options for RememberMe success handler, and I can see the full list of options here: http: //symfony.com/doc/current/reference/configuration/security.html .

security: firewalls: secure_area: form_login: success_handler: some.service.id 

How should I do it? Thanks in advance.

0
source share
1 answer

Users who authenticate through remember me get the IS_AUTHENTICATED_REMEMBERED role.

Check the user roles for this role in the regular success handler and complete the required actions.

-one
source

Source: https://habr.com/ru/post/1492695/


All Articles