Add the ability to redirect after password reset

Created on 22 October 2019, over 4 years ago
Updated 5 July 2023, 12 months ago

The task is to add the ability to redirect to a specific page after reset password using the link from the mail.

✨ Feature request
Status

Closed: won't fix

Version

8.7 ⚰️

Component
User moduleΒ  β†’

Last updated about 3 hours ago

Created by

πŸ‡§πŸ‡ΎBelarus xanderzakh Minsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium flyke

    This worked for me. It was not $form['#submit'] that I needed to alter, but instead $form['actions']['submit']['#submit'].

    /**
     * Implements hook_form_FORM_ID_alter().
     */
    function mymodule_form_user_form_alter(&$form, FormStateInterface $form_state) {
      $form['actions']['submit']['#submit'][] = '_mymodule_homepage_redirect_submit_handler';
    }
    
    /**
     * Custom submit callback to redirect to the homepage.
     */
    function _mymodule_homepage_redirect_submit_handler(array &$form, FormStateInterface $form_state) {
      // Redirect the user to the homepage.
      $form_state->setRedirect('<front>');
    }
Production build 0.69.0 2024