Problem/Motivation

If login page is frontpage, destination parameter is not set. Hence after the user actually finishes login, Drupal doesn't redirect to the previous destination.

This issue seems to have added the support for allowing "<front>" to be considered as frontpage: https://www.drupal.org/project/r4032login/issues/2748151. But it is unclear why it does not sets the destination parameter.

Steps to reproduce

- Set your login page on <front> and specify this in the module config as such as well
- Try to access some protected route that only authenticated user can access
- User will be redirected to login page (which incidentally is frontpage in this case) with but ?destination parameter won't be set
- After user logs in, then user will not be redirected to the destination

Proposed resolution

- Do not make exception for <front> route
- OR mention the motivation for it and how to get around it: https://www.drupal.org/project/r4032login/issues/2748151

Comments

gupta324 created an issue. See original summary.

lihsus’s picture

Issue summary: View changes
lihsus’s picture

Issue summary: View changes
lihsus’s picture

Issue summary: View changes
lihsus’s picture

Issue summary: View changes
lihsus’s picture

Here's a patch.

lihsus’s picture

Status: Active » Needs review
juhog’s picture

Status: Needs review » Reviewed & tested by the community

Patch #6 works for our project, on Drupal 9.2.4. Destination parameter stays intact when r4032login module redirects to frontpage.

nixou’s picture

StatusFileSize
new2.95 KB
new1.66 KB

Thank you.

I adapted the corresponding test to cover that.

  • Nixou committed 0f50c1b on 2.x authored by gupta324
    Issue #3217512 by Nixou, gupta324: If login page is frontpage, user is...
nixou’s picture

Committed to 2.x-dev, will be released in 2.1.1.

nixou’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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