acseo/change-password-bundle
Symfony bundle for managing user password history with FOSUserBundle: stores previous hashed passwords, forces change when passwords are older than 30 days, and optionally blocks reusing old passwords via a validation constraint.
#User Password History Management
This Bundle allows to manage user password history. It has been developped and tested to work with the famous FOSUserBundle Bundle.
What this bundle does :
composer require 'acseo/change-password-bundle:dev-master'
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
//...
new ACSEO\ChangePasswordBundle\ACSEOChangePasswordBundle(),
//...
Edit your config file :
# app/config/config.yml
doctrine:
orm:
resolve_target_entities:
"FOS\UserBundle\Model\User": "YourBundle\Entity\YourUser"
$ app/console doctrine:schema:update --dump-sql
$ app/console doctrine:schema:update --force
From now Password History is set up. The table password_history will store the changed user password whenever this password is changed
# src/YourBundle/Resources/config/validation.yml
YourBundle\Entity\YourUser:
properties:
# ...
plainPassword:
- ACSEO\ChangePasswordBundle\Validator\Constraints\NotInPreviousPasswords: ~
And that's it !
Feel free to comment or improve this bundle by creating issues or submitting pull requests
How can I help you explore Laravel packages today?