When configuring a login destination rule for the trigger "One-time login link" and the setting "Redirect immediately after using one-time login link" is not enabled, the redirect should not happen immediately after login, but after the user submits the user account form (so the user has a chance to change his/her password).

If the setting "Redirect immediately after using one-time login link" is enabled, the user should still be redirected immediately.

Patch with tests will follow.

Comments

MegaChriz created an issue. See original summary.

megachriz’s picture

Assigned: megachriz » Unassigned
Status: Active » Needs review
StatusFileSize
new8.48 KB
new11.05 KB

This patch should fix the issue and provides a test.

Also tests for triggers "Registration", "Login" and "Logout"

Besides a test for the trigger "One-time login link", tests for the other three triggers are also added in this patch. Usually it is a best practice to keep an issue focussed and not add other things to it. But I figured if I would provide these changes separately, then if one gets committed, the other one needs to be rerolled. So I guess that in this case it would be more productive to provide the changes combined. If requested or if one of the other tests would fail, I could still provide the changes separately.

megachriz’s picture

(Setting organization attribution)

megachriz’s picture

While testing, I found one bug with my patch in #2: when the "Immediate redirect" setting was not enabled, the trigger for "login" was executed when using a one-time login link.

The attached patch fixes that issue and adds tests that each trigger is not activated when not configured. For example: no redirect should happen on logout when only a destination rule exist for login.

I also added a test that ensures that a destination rule configured for the one-time login trigger does not activate when someone already logged in is updating their account.

miroslav-lee’s picture

I tested this patch. It works for me

  • rsvelko committed e60ea3f on 8.x-1.x authored by MegaChriz
    Issue #3006755 by MegaChriz: Redirect for one-time login should happen...
rsvelko’s picture

Thanks, @MegaChriz!
Tested it, committed, all good here.

megachriz’s picture

@rsvelko
Thanks for testing and committing!

rsvelko’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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