From a4c8b08f3819aef14712703283a5448750ce6172 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Thu, 23 Apr 2020 15:27:51 -0400 Subject: [PATCH 1/8] draft reset password doc --- security/reset_password.rst | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 security/reset_password.rst diff --git a/security/reset_password.rst b/security/reset_password.rst new file mode 100644 index 00000000000..adf5fe8adf1 --- /dev/null +++ b/security/reset_password.rst @@ -0,0 +1,56 @@ +How to add secure forgotten password functionality +================================================== + +Using `MakerBundle`_ & `Symfony Cast's Reset Password Bundle`_ you can create a +secure out of the box solution to handle forgotten passwords. + +.. caution:: + + Make sure you have created a ``User`` class with a getter method to retrieve + the users unique email address. The :doc:`Security Guide ` will help you + install security. + +Bootstrap reset password functionality +--------------------------------------------- + +.. code-block:: terminal + + $ php composer require symfonycasts/reset-password-bundle + ..... + $ php bin/console make:reset-password + + +The reset password maker will then ask you a couple questions about your app and +generate the required files. Afterword's you should see a list of the files generated. + +.. code-block:: terminal + + created: src/Controller/ResetPasswordController.php + created: src/Entity/ResetPasswordRequest.php + created: src/Repository/ResetPasswordRequestRepository.php + updated: config/packages/reset_password.yaml + created: src/Form/ResetPasswordRequestFormType.php + created: src/Form/ChangePasswordFormType.php + created: templates/reset_password/check_email.html.twig + created: templates/reset_password/email.html.twig + created: templates/reset_password/request.html.twig + created: templates/reset_password/reset.html.twig + + + Success! + + + Next: + 1) Run "php bin/console make:migration" to generate a migration for the new "App\Entity\ResetPasswordRequest" entity. + 2) Review forms in "src/Form" to customize validation and labels. + 3) Review and customize the templates in `templates/reset_password`. + 4) Make sure your MAILER_DSN env var has the correct settings. + + Then open your browser, go to "/reset-password" and enjoy! + +You can customize the reset password bundle's behavior by editing ``reset_password.yaml``. +For more information on the configuration, check out the +`Symfony Cast's Reset Password Bundle`_ guide. + +.. _`MakerBundle`: https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html +.. _`Symfony Cast's Reset Password Bundle`: https://github.com/symfonycasts/reset-password-bundle From da7b2b35d60de5d86117e3d880c32e9146509212 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Thu, 23 Apr 2020 15:33:22 -0400 Subject: [PATCH 2/8] link reset password doc in security --- security.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/security.rst b/security.rst index 9384426da5d..81031c9b3df 100644 --- a/security.rst +++ b/security.rst @@ -1015,6 +1015,7 @@ Authentication (Identifying/Logging in the User) :maxdepth: 1 security/form_login_setup + security/reset_password security/json_login_setup security/guard_authentication security/password_migration From c8a9d4609bbede7f6536888ef09b64d1e1380350 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Thu, 23 Apr 2020 15:49:34 -0400 Subject: [PATCH 3/8] fix title --- security/reset_password.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/reset_password.rst b/security/reset_password.rst index adf5fe8adf1..32765ec8eda 100644 --- a/security/reset_password.rst +++ b/security/reset_password.rst @@ -1,4 +1,4 @@ -How to add secure forgotten password functionality +How To Add Secure Password Reset Functionality ================================================== Using `MakerBundle`_ & `Symfony Cast's Reset Password Bundle`_ you can create a From 03032758d6450ef6351a6370b6f2729f292f7038 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Thu, 23 Apr 2020 16:43:59 -0400 Subject: [PATCH 4/8] remove generated code --- security/reset_password.rst | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/security/reset_password.rst b/security/reset_password.rst index 32765ec8eda..d0344120c16 100644 --- a/security/reset_password.rst +++ b/security/reset_password.rst @@ -21,32 +21,8 @@ Bootstrap reset password functionality The reset password maker will then ask you a couple questions about your app and -generate the required files. Afterword's you should see a list of the files generated. - -.. code-block:: terminal - - created: src/Controller/ResetPasswordController.php - created: src/Entity/ResetPasswordRequest.php - created: src/Repository/ResetPasswordRequestRepository.php - updated: config/packages/reset_password.yaml - created: src/Form/ResetPasswordRequestFormType.php - created: src/Form/ChangePasswordFormType.php - created: templates/reset_password/check_email.html.twig - created: templates/reset_password/email.html.twig - created: templates/reset_password/request.html.twig - created: templates/reset_password/reset.html.twig - - - Success! - - - Next: - 1) Run "php bin/console make:migration" to generate a migration for the new "App\Entity\ResetPasswordRequest" entity. - 2) Review forms in "src/Form" to customize validation and labels. - 3) Review and customize the templates in `templates/reset_password`. - 4) Make sure your MAILER_DSN env var has the correct settings. - - Then open your browser, go to "/reset-password" and enjoy! +generate the required files. Afterword's you should see the success message, +a list of the files generated, and any other task's that may need to be performed. You can customize the reset password bundle's behavior by editing ``reset_password.yaml``. For more information on the configuration, check out the From 6e39c5c0e5f0f2be4dbe38f004fc5d61122f8c7c Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Thu, 23 Apr 2020 16:46:58 -0400 Subject: [PATCH 5/8] fix typo --- security/reset_password.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/reset_password.rst b/security/reset_password.rst index d0344120c16..500e44c61ee 100644 --- a/security/reset_password.rst +++ b/security/reset_password.rst @@ -1,4 +1,4 @@ -How To Add Secure Password Reset Functionality +How to Add Secure Password Reset Functionality ================================================== Using `MakerBundle`_ & `Symfony Cast's Reset Password Bundle`_ you can create a From e964751c24c007c7755a9fdf0274b981c78a120b Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Thu, 23 Apr 2020 16:53:04 -0400 Subject: [PATCH 6/8] refactor caution msg --- security/reset_password.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/security/reset_password.rst b/security/reset_password.rst index 500e44c61ee..10a99403dc6 100644 --- a/security/reset_password.rst +++ b/security/reset_password.rst @@ -1,5 +1,5 @@ How to Add Secure Password Reset Functionality -================================================== +============================================== Using `MakerBundle`_ & `Symfony Cast's Reset Password Bundle`_ you can create a secure out of the box solution to handle forgotten passwords. @@ -7,11 +7,11 @@ secure out of the box solution to handle forgotten passwords. .. caution:: Make sure you have created a ``User`` class with a getter method to retrieve - the users unique email address. The :doc:`Security Guide ` will help you - install security. + the users unique email address. The :doc:`Security Guide ` will + help you install security and create your user class. Bootstrap reset password functionality ---------------------------------------------- +-------------------------------------- .. code-block:: terminal From e065dffb017e0121c83080ad31379172930e0dc2 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 29 May 2020 09:43:09 -0400 Subject: [PATCH 7/8] proofreading reset password --- security/reset_password.rst | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/security/reset_password.rst b/security/reset_password.rst index 10a99403dc6..60b7597ff01 100644 --- a/security/reset_password.rst +++ b/security/reset_password.rst @@ -1,17 +1,14 @@ -How to Add Secure Password Reset Functionality -============================================== +How to Add a Reset Password Feature +=================================== -Using `MakerBundle`_ & `Symfony Cast's Reset Password Bundle`_ you can create a +Using `MakerBundle`_ & `SymfonyCastsResetPasswordBundle`_ you can create a secure out of the box solution to handle forgotten passwords. -.. caution:: +First, make sure you have a security ``User`` class. Follow +the :doc:`Security Guide ` if you don't have one already. - Make sure you have created a ``User`` class with a getter method to retrieve - the users unique email address. The :doc:`Security Guide ` will - help you install security and create your user class. - -Bootstrap reset password functionality --------------------------------------- +Generating the Reset Password Code +---------------------------------- .. code-block:: terminal @@ -19,14 +16,13 @@ Bootstrap reset password functionality ..... $ 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. -The reset password maker will then ask you a couple questions about your app and -generate the required files. Afterword's you should see the success message, -a list of the files generated, and any other task's that may need to be performed. - -You can customize the reset password bundle's behavior by editing ``reset_password.yaml``. -For more information on the configuration, check out the -`Symfony Cast's Reset Password Bundle`_ guide. +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. .. _`MakerBundle`: https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html .. _`Symfony Cast's Reset Password Bundle`: https://github.com/symfonycasts/reset-password-bundle From 9b484fc6c33cd20f20360350618123e630a60f8c Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 29 May 2020 10:42:39 -0400 Subject: [PATCH 8/8] fixing link --- security/reset_password.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/reset_password.rst b/security/reset_password.rst index 60b7597ff01..7899440ba86 100644 --- a/security/reset_password.rst +++ b/security/reset_password.rst @@ -25,4 +25,4 @@ file. For more information on the configuration, check out the `SymfonyCastsResetPasswordBundle`_ guide. .. _`MakerBundle`: https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html -.. _`Symfony Cast's Reset Password Bundle`: https://github.com/symfonycasts/reset-password-bundle +.. _`SymfonyCastsResetPasswordBundle`: https://github.com/symfonycasts/reset-password-bundle