I have been googling for a couple hours now and cannot find any information on how to implement the "Forgot Password" functionality in FOSUserBundle
Is this part of the bundle or is it something I have to create myself.
The FOSUserBundle adds support for a database-backed user system in Symfony2+. It provides a flexible framework for user management that aims to handle common tasks such as user registration and password retrieval. Features include: Users can be stored via Doctrine ORM or MongoDB/CouchDB ODM.
Actually it is weird that you didn't find anything about it, you probably didn't search with good terms (maybe reset instead of forgot). Anyway it's a pretty simple process. You probably read the github documentation, it's explained there (Step 6) that you have to import the routing.xml file and furthermore this route :
fos_user_resetting: resource: "@FOSUserBundle/Resources/config/routing/resetting.xml" prefix: /resetting
You just have to add a link in your template with the fos_user_resetting_request route :
<a href="{{ path('fos_user_resetting_request') }}">Forgot password ?</a>
Then a click on this link will lead the user to a reset form which will ask the user email and send them an email with a security token in the link to the password edit form.
If you want to customize the render, read these docs :
Does it help you? Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With