Persist destination on redirect

Created on 17 August 2021, almost 3 years ago
Updated 24 August 2023, 10 months ago

Problem/Motivation

When going through the TFA form the original destination is lost and the user always ends up on the front page. This is a particular issue with password resets, because the user is no longer prompted to set a new password.

Steps to reproduce

Reset your password, follow the link, end up on the front page.

Proposed resolution

Track the intended destination using the destination query parameter.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Owen Barton

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.

  • πŸ‡ΈπŸ‡¦Saudi Arabia abdulaziz zaid Riyadh

    Hi Everyone, thank you

    I did a new patch to can fix any destination and I Edit the merge request and added the below code on the class EmailTfaVerifyForm.

        if ($this->request->query->get('destination')) {
          // save the destination in the $form_state to be used on submit.
          $form_state->set('destination', $this->request->query->get('destination'));
          //Remove the destination from the query string.
          $this->request->query->remove('destination');
        }   
    

    on submit form :

          // get the destination from the $form_state.
          $destination = $form_state->get('destination');
          // use the destination from the $form_state if it exists
          if ($destination) {
            $url = Url::fromUserInput($destination);
          }
          else {
            $url = Url::fromRoute('<front>');
          }
    

    can anyone review the patch?

  • Status changed to Fixed 10 months ago
  • πŸ‡ΈπŸ‡¦Saudi Arabia abdulaziz zaid Riyadh

    FIXED.

  • πŸ‡ΈπŸ‡¦Saudi Arabia abdulaziz zaid Riyadh

    Publish in version 1.0.7.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024