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
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | interdiff.txt | 1.66 KB | nixou |
| #9 | 3217512-9.patch | 2.95 KB | nixou |
| #6 | apply_dest_if_front_is_login_page_as_well-3217512-6.patch | 1.17 KB | lihsus |
Comments
Comment #2
lihsus commentedComment #3
lihsus commentedComment #4
lihsus commentedComment #5
lihsus commentedComment #6
lihsus commentedHere's a patch.
Comment #7
lihsus commentedComment #8
juhog commentedPatch #6 works for our project, on Drupal 9.2.4. Destination parameter stays intact when r4032login module redirects to frontpage.
Comment #9
nixou commentedThank you.
I adapted the corresponding test to cover that.
Comment #11
nixou commentedCommitted to 2.x-dev, will be released in 2.1.1.
Comment #12
nixou commented