Symfony2 and FOSUserBUndle - force the user to change the password

I need to get users to change their password at least once every 30 days. Where to begin? I noted in the database that users of the table have a credentials_expire_at column, and when it is set to the last date, such a user cannot log in, and I thought about allowing password changes in the login form when a message about expiration date.

+4
source share
1 answer

You need to do it like this:

  • Create an EventListener in an onSecurityInteractiveLogin event
  • Check Date
  • If it fails to redirect to change the password form

Have a look at this coderwall run: http://coderwall.com/p/cfmbaq

+3
source

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


All Articles