Problem/Motivation

When the TOTP plugin is setup for the first time, the form doesn't get correctly redirected to the TFA overview form. This is because Form API doesn't see the redirect response. This leaves the visitor confused, like the TFA hasn't been setup correctly.

Steps to reproduce

Setup TFA TOTP for the first time.

Proposed resolution

Add a redirect response to the submit form.

Remaining tasks

Review and commit patch.

Issue fork tfa-3488682

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dubs created an issue. See original summary.

dubs’s picture

StatusFileSize
new831 bytes
dubs’s picture

StatusFileSize
new1.2 KB

Ah - wrong patch! Correct one here.

cmlara’s picture

Status: Needs review » Needs work

Is this possibly a duplicate of #3451488: Full Setup not working on 8.x-1.7 or are they separate faults?

Drupal.org (and the TFA project) have migrated away from patch files. The infrastructure to test and merge has been replaced with Merge Requests.

More details on working with merge requests may be found in Using GitLab to Contribute to Drupal.

Setting needs-work to allow for feedback on if issues are related, and to convert to MR.

dubs’s picture

This is a different issue here, and at somepoint I'll make a MR for this change.

cmlara’s picture

sayan_k_dutta’s picture

Assigned: Unassigned » sayan_k_dutta

Picking it up, creating MR.

sayan_k_dutta’s picture

Assigned: sayan_k_dutta » Unassigned
Status: Needs work » Needs review

Created the MR !100.
Please anyone check for failing PHPUnit tests, as I have no knowledge of it.

cmlara’s picture

Status: Needs review » Needs work

Needs work as the proposed patch implies there is a deeper root fault that should be identified and fixed.

sayan_k_dutta’s picture

Again tried to reproduce the error in Drupal 10.4.0, there seems to be no issue for 2.x branch of the modulew. On first time Tfa setup with TOTP, in Tfa configuration page if the "Redirect users on login to TFA Setup Page" option is enabled, the user is correctly redirected to the tfa overview form asking the user to set up tfa.

cmlara’s picture

@sayan_k_dutta 'Redirect users on login to TFA Setup Page' impacts the Login logic this issue apepars to be about the Token Provisioning (TFASetupForm) which is indepdnet of the login logic.

cmlara’s picture

setRedirect() is overridden if the form is 're-building'. We do trigger from rebuild in multiple places. This is the most likely cause and should be investigated with a debugger to validate.