22

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.

Bill Woodger
  • 12,968
  • 4
  • 38
  • 47
smugford
  • 769
  • 2
  • 10
  • 20

1 Answers1

47

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!

lenybernard
  • 2,399
  • 22
  • 22
  • 3
    I did search for reset password instead of forgot password. I also saw it after looking at your entry with php app/console router:debug i was using /resetting instead of /resetting/request thank you – smugford Dec 01 '13 at 05:26