Problem/Motivation

Upon form submission, ChangePasswordForm stays on the same page as before, showing a status message. It would be nice to check for Drupal ?destination= query param to redirect users if needed.

Also, the ChangePasswordForm class uses $_SESSION global arrays. It would be nice to change that to the Symfony session service to improve code quality.

Proposed resolution

Use the getRedirectDestination() method that is already present in the form base to redirect users to ?destination= path.

Import the SessionInterface service to the form and use it instead of $_SESSION.

Comments

dlevchik created an issue. See original summary.

dlevchik’s picture

Title: Use redirect.destination service, use symphony session » Use redirect.destination service, use Symfony session