SymfonyWorld Online 2020
100% online
30+ talks + workshops
Live + Replay watch talks later
WARNING: You are browsing the documentation for Symfony 5.0 which is not maintained anymore. Consider upgrading your projects to Symfony 5.1.

How to Add a Reset Password Feature

5.0 version
Maintained Unmaintained

How to Add a Reset Password Feature

Using MakerBundle & SymfonyCastsResetPasswordBundle you can create a secure out of the box solution to handle forgotten passwords.

First, make sure you have a security User class. Follow the Security Guide if you don’t have one already.

Generating the Reset Password Code

$ php composer require symfonycasts/reset-password-bundle
$ php bin/console make:reset-password

The make:reset-password command will ask you a few questions about your app and generate all the files you need! After, you’ll see a success message and a list of any other steps you need to do.

You can customize the reset password bundle’s behavior by updating the reset_password.yaml file. For more information on the configuration, check out the SymfonyCastsResetPasswordBundle guide.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.