• Stars
    star
    402
  • Rank 107,042 (Top 3 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Need a killer reset password feature for your Symfony? Us too!

ResetPasswordBundle: Mind-Blowing (and Secure) Password Resetting for Symfony

Worrying about how to deal with users that can't remember their password? We've got you covered! This bundle provides a secure out of the box solution to allow users to reset their forgotten passwords.

Installation

The bundle can be installed using Composer or the Symfony binary:

composer require symfonycasts/reset-password-bundle

Usage

There are two ways to get started, the easiest and preferred way is to use Symfony's MakerBundle. The Maker will take care of everything from creating configuration, to generating your templates, controllers, and entities.

Using Symfony's Maker Bundle (Recommended)

  • Run bin/console make:reset-password, answer a couple questions, and enjoy our bundle!

Setting things up manually

If you prefer to take care of the leg work yourself, checkout the manual setup guide. We still recommend using the Maker command to get a feel for how we intended the bundle to be used.


If you used our Symfony Maker command bin/console make:reset-password after installation, your app is ready to go. Go to https://your-apps-domain/reset-password, fill out the form, click on the link sent to your email, and change your password. That's it! The ResetPasswordBundle takes care of the rest.

The above assumes you have already setup authentication with a registered user account & configured Symfony's mailer in your app.

Configuration

You can change the default configuration parameters for the bundle in the config/packages/reset_password.yaml config file created by Maker.

symfonycasts_reset_password:
    request_password_repository: App\Repository\PasswordResetRequestRepository
    lifetime: 3600
    throttle_limit: 3600
    enable_garbage_collection: true

The production environment may require the default_uri to be defined in the config/packages/routing.yaml to prevent the URI in emails to point to localhost.

# config/packages/routing.yaml
when@prod:
    framework:
        router:
            # ...
            default_uri: '<your project's root URI>'

Parameters:

request_password_repository

Required

The complete namespace of the repository for the ResetPasswordRequest entity. If you used make:reset-password, this will be App\Repository\ResetPasswordRequestRepository.

lifetime

Optional - Defaults to 3600 seconds

This is the length of time a reset password request is valid for in seconds after it has been created.

throttle_limit

Optional - Defaults to 3600 seconds

This is the length of time in seconds that must pass before a user can request a subsequent reset request.

Setting this value equal to or higher than lifetime will prevent a user from requesting a password reset before a previous reset attempt has either 1) Been successfully completed. 2) The previous request has expired.

Setting this value lower than lifetime will allow a user to make several reset password requests, even if any previous requests have not been successfully completed or have not expired. This would allow for cases such as a user never received the reset password request email.

enable_garbage_collection

Optional - Defaults to true

Enable or disable the Reset Password Cleaner which handles expired reset password requests that may have been left in persistence.

Support

Feel free to open an issue for questions, problems, or suggestions with our bundle. Issues pertaining to Symfony's Maker Bundle, specifically make:reset-password, should be addressed in the Symfony Maker repository.

Security Issues

For security related vulnerabilities, we ask that you send an email to ryan [at] symfonycasts.com instead of creating an issue.

This will give us the opportunity to address the issue without exposing the vulnerability before a fix can be published.

More Repositories

1

verify-email-bundle

Simple, stylish Email Verification for Symfony
PHP
342
star
2

messenger-monitor-bundle

Visual Monitoring & Retries for Symfony Messenger!
CSS
73
star
3

symfony5

Screencast code, script and sunshine behind the Symfony 5 tutorials!
Twig
56
star
4

api-platform

Screencast code, script and everlasting friendship behind the "API Platform" tutorial
PHP
29
star
5

vue

Screencast code, script and cupcakes behind the "The Delightful World of Vue.js" tutorial
PHP
16
star
6

symfony-ux

Screencast code, script and everlasting friendship behind the "Symfony UX: Stimulus" tutorial
PHP
13
star
7

dynamic-forms

Add dynamic/dependent fields to Symfony forms
PHP
10
star
8

symfony6

Screencast code, script and the macaroni and cheese behind the "Harmonious Development with Symfony 6" tutorial
Twig
8
star
9

messenger

Screencast code, script and unicorns behind the "Messenger! Queue work for Later" tutorial
PHP
7
star
10

EasyAdminBundle

Course code behind EasyAdminBundle v3
PHP
6
star
11

solid

Screencast code, script and puppies behind the "Write SOLID Code & Impress your Friends" tutorial
CSS
6
star
12

micro-mapper

A tiny, underwhelming data mapper for Symfony to map one object to another!
PHP
5
star
13

workshop_symfonycon18_encore

Nothing to see here! Just some code from the SymfonyCon 2018 Webpack Encore workshop
PHP
4
star
14

conferences

Metadata, transcripts and true grit behind the Symfony Conferences on SymfonyCasts
3
star
15

deep-symfony-dive

Screencast code, script and kittens behind the "Symfony 5 Deep Dive!" tutorial
JavaScript
3
star
16

dino-park

A place for us to track our dinosaurs 🦕
3
star
17

vinyl-mixes

A "data" repository for our Symfony 6 Tutorials!
2
star
18

tailwind-bundle

Delightful Tailwind Support for Symfony + AssetMapper
PHP
2
star
19

workshop_symfonycon19_encore

Nothing to see here! Just some code from the SymfonyCon 2019 Webpack Encore workshop
PHP
2
star
20

sfcon2018

Screencast code, script and puppies behind the "SymfonyCon 2018 Lisbon Conference Videos" tutorial
2
star
21

design-patterns

Design Patterns tutorial code
PHP
2
star
22

symfony5-challenges

Challenges for "Charming Development in Symfony 5"
2
star
23

asset-mapper

Screencast code, script and freckles behind the "AssetMapper: Modern JS with Zero Build System" tutorial
PHP
1
star
24

testing-temi-integration

Nothing to see here folks!
1
star
25

turbo-challenges

Challenges for "Symfony UX: Turbo"
1
star
26

api-platform3

Screencast code, script and glitter behind the "API Platform 3" tutorial
PHP
1
star
27

symfony5-security-challenges

Challenges for "Symfony 5 Security: Authenticators"
1
star
28

.github

1
star
29

vue-challenges

Challenges for "The Delightful World of Vue.js"
1
star
30

blackfire

Screencast code, script and flower petals behind the "Blackfire.io: Revealing Performance Secrets with Profiling" tutorial
JavaScript
1
star
31

doctrine-queries

SQL, DQL, Query Builders and code for the "Query Like a Pro in Doctrine" series - updated version of https://github.com/knpuniversity/doctrine-queries
JavaScript
1
star
32

testing

Screencast code, script and true grit behind the "PHPUnit: Testing with a Bite!" tutorial
Twig
1
star