Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add form type for reset password request #1489

Merged

Conversation

jordisala1991
Copy link
Member

@jordisala1991 jordisala1991 commented Jan 31, 2022

Subject

I am targeting this branch, because this breaks BC.

Closes #784
Part of #1465

Changelog

### Added
- Added `ResetPasswordRequestFormType` form type.

@jordisala1991 jordisala1991 linked an issue Jan 31, 2022 that may be closed by this pull request
9 tasks
@jordisala1991 jordisala1991 marked this pull request as ready for review February 2, 2022 07:28
@jordisala1991 jordisala1991 requested a review from a team February 2, 2022 07:45
@jordisala1991
Copy link
Member Author

jordisala1991 commented Feb 2, 2022

I have unified both the request of the password reset and the POST route. This way we can take advantage of the Symfony form validations and show errors to the user if he submits invalid data (no data in this case is the only considered invalid).

I have also added more functional tests to ensure when we submit invalid data on both forms we get proper response.

I don't like a lot having 10 dependencies for one controller but refactoring that requires more classes, so the idea is that we choose between:

  1. Not using Symfony forms in the reset password request and have separate controllers (no validation, but whatever)
  2. Use Symfony forms in the reset password request and have one controller (it can be refactored later, but not sure if I will invest more time to it)

wdyt @VincentLanglet , is it worth?

@VincentLanglet
Copy link
Member

Use Symfony forms in the reset password request and have one controller (it can be refactored later, but not sure if I will invest more time to it)

I'm ok with this so far

@jordisala1991 jordisala1991 merged commit fd93b90 into sonata-project:5.x Feb 2, 2022
@jordisala1991 jordisala1991 deleted the improvement/add-form-type branch February 2, 2022 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use twig blocks for form rendering
2 participants