{"id":18929437,"url":"https://github.com/thecodingmachine/security.forgot-your-password","last_synced_at":"2025-07-26T03:05:34.721Z","repository":{"id":57020144,"uuid":"63943976","full_name":"thecodingmachine/security.forgot-your-password","owner":"thecodingmachine","description":"A 'forgot your password' feature for Mouf security.","archived":false,"fork":false,"pushed_at":"2018-01-08T18:55:52.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":8,"default_branch":"1.0","last_synced_at":"2025-04-11T18:59:50.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-22T10:06:01.000Z","updated_at":"2016-07-22T11:18:20.000Z","dependencies_parsed_at":"2022-08-22T20:31:17.987Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/security.forgot-your-password","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsecurity.forgot-your-password","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsecurity.forgot-your-password/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsecurity.forgot-your-password/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fsecurity.forgot-your-password/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/security.forgot-your-password/tar.gz/refs/heads/1.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248600617,"owners_count":21131517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:32:44.529Z","updated_at":"2025-04-15T15:30:57.459Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/mouf/security.forgot-your-password/v/stable)](https://packagist.org/packages/mouf/security.forgot-your-password)\n[![Total Downloads](https://poser.pugx.org/mouf/security.forgot-your-password/downloads)](https://packagist.org/packages/mouf/security.forgot-your-password)\n[![Latest Unstable Version](https://poser.pugx.org/mouf/security.forgot-your-password/v/unstable)](https://packagist.org/packages/mouf/security.forgot-your-password)\n[![License](https://poser.pugx.org/mouf/security.forgot-your-password/license)](https://packagist.org/packages/mouf/security.forgot-your-password)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/security.forgot-your-password/badges/quality-score.png?b=1.0)](https://scrutinizer-ci.com/g/thecodingmachine/security.forgot-your-password/?branch=1.0)\n[![Build Status](https://travis-ci.org/thecodingmachine/security.forgot-your-password.svg?branch=1.0)](https://travis-ci.org/thecodingmachine/security.forgot-your-password)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/security.forgot-your-password/badge.svg?branch=1.0\u0026service=github)](https://coveralls.io/github/thecodingmachine/security.forgot-your-password?branch=1.0)\n\nForgot your password feature for Mouf\n=====================================\n\nThis package contains the controllers and services necessary to implement a \"forgot your password\" feature in Mouf.\n\nInstallation\n============\n\n```\ncomposer require mouf/security.forgot-your-password\n```\n\nUsage\n=====\n\nInstall the package using the Mouf installer.\n\nThis package **provides**:\n\n- A controller (`ForgotYourPasswordController`): this controller provides the default `forgot/password` route that leads to the \"I forgot my password\" form.\n  It also provides the `forgot/reset` route that is linked to in the mail. This route allows the user to reset its password.\n- A service (`ForgotYourPasswordService`): this service is in charge of generating the unique token and sending the mail.\n\nThis package **does not contain** a way to access your database to store/retrieve tokens and associated users. For this, you need to provide a package implementing the [`ForgotYourPasswordDao` interface](http://mouf-php.com/packages/mouf/security.forgot-your-password-interface).\nFor this, you might want to you an existing package already implementing it. If you are using TDBM, we recommend using [mouf/security.daos.tdbm](http://mouf-php.com/packages/mouf/security.daos.tdbm).\n\nCustomizing\n===========\n\nIn this package, the views are based on the Bootstrap framework CSS. If your project uses another framework, you'll need to overwrite the views.\n\nCustomizing the \"forgot your password\" page\n-------------------------------------------\n\nThe main \"forgot your password\" form is rendered using the `Mouf\\Security\\Password\\ForgotYourPasswordView`.\nThe Twig template is available in `vendor/mouf/security.forgot-your-password/src/templates/Mouf/Security/Password/ForgotYourPasswordView.twig`.\nTo overwrite, copy this file to `src/templates/Mouf/Security/Password/ForgotYourPasswordView.twig` and purge your cache.\n\nCustomizing the \"email sent\" page\n---------------------------------\n\nOnce the \"forgot your password\" page is filled, the user arrives on the \"email sent\" page.\n\nThe page is rendered using the `Mouf\\Security\\Password\\EmailSentView`.\nThe Twig template is available in `vendor/mouf/security.forgot-your-password/src/templates/Mouf/Security/Password/EmailSentView.twig`.\nTo overwrite, copy this file to `src/templates/Mouf/Security/Password/EmailSentView.twig` and purge your cache.\n\nCustomizing the email\n---------------------\n\nThe email originates from a [`SwiftTwigMailTemplate`](https://github.com/thecodingmachine/swift-twig-mail-template).\n\nIf you want to customize this email, you can either:\n\n- change the Twig template completely (by editing the |forgotYourPasswordMailTemplate` instance in the container and modifying the `twigPath` property to your own file)\n- or you can simply overwrite the i18n strings by providing your own keys for the subject and the body:\n    - `forgotyourpassword.mail.subject` is the subject\n    - `forgotyourpassword.mail.body` is the body of the text\n    \nCustomizing the \"token not found\" page\n--------------------------------------\n\nIn case the user clicks on a URL link with a token that has already been used (or that is invalid), the \"token not found\" page is displayed.\n\nThe page is rendered using the `Mouf\\Security\\Password\\TokenNotFoundView`.\nThe Twig template is available in `vendor/mouf/security.forgot-your-password/src/templates/Mouf/Security/Password/TokenNotFoundView.twig`.\nTo overwrite, copy this file to `src/templates/Mouf/Security/Password/TokenNotFoundView.twig` and purge your cache.\n\nCustomizing the \"reset password\" page\n-------------------------------------\n\nWhen the user clicks on the link in the mail, he is redirected to the \"reset password\" page.\n\nThe page is rendered using the `Mouf\\Security\\Password\\ResetPasswordView`.\nThe Twig template is available in `vendor/mouf/security.forgot-your-password/src/templates/Mouf/Security/Password/ResetPasswordView.twig`.\nTo overwrite, copy this file to `src/templates/Mouf/Security/Password/ResetPasswordView.twig` and purge your cache.\n\nCustomizing the \"password reseted\" page\n---------------------------------------\n\nThis is the last page of the workflow, confirming the password was reset successfully.\n\nThe page is rendered using the `Mouf\\Security\\Password\\ConfirmResetPasswordView`.\nThe Twig template is available in `vendor/mouf/security.forgot-your-password/src/templates/Mouf/Security/Password/ConfirmResetPasswordView.twig`.\nTo overwrite, copy this file to `src/templates/Mouf/Security/Password/ConfirmResetPasswordView.twig` and purge your cache.\n\nCustomizing password check strength\n-----------------------------------\n\nBy default when you reset your password, you will be asked a password that is:\n\n- at least 7 characters long\n- that contains at least one upper case letter\n- that contains at least one lower case letter\n- that contains at least one number\n\nThis can be completely configured in the `Mouf\\Security\\Password\\PasswordStrengthCheck` instance.\n\nAlso, if you have very specific needs regarding password strength (for instance: at least 2 special characters, only japanese characters allowed, etc...), then you can simply provide your own service as long as it implements `Mouf\\Security\\Password\\Api\\PasswordStrengthCheck`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fsecurity.forgot-your-password","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fsecurity.forgot-your-password","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fsecurity.forgot-your-password/lists"}