Retain query params when redirecting from user to user/login

Created on 15 March 2022, over 2 years ago
Updated 2 May 2024, 4 months ago

Problem/Motivation

When you access '/user?foo=bar' as an anonymous user it redirects user to 'user/login'. It losing query parameter.
I have 3rd party integration where it will redirect user to '/user?url='external_url'. If user is not logged-in Drupal redirects user to 'user/login' page without query parameters.
Also I think its always best to preserve query parameter when there is automatic redirect.

Steps to reproduce

Proposed resolution

Find attached user-login-redirect-missing-query-param.patch patch

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
User module 

Last updated 1 day ago

Created by

🇮🇳India pmkanse

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.

    As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)". This issue was marked "Postponed (maintainer needs more info)" more than 6 months ago. I see that more information was added to the issue summary after the request for more information.

    IMO this is not a bug. I suppose it could be a feature request but IMO I don't think this should be added. Like @longwave noted in #8, you can just use the /user/login path instead.

    I'm tagging for the Bug Smash Initiative but I vote to close this as "won't fix" or, at minimum, moving this to a feature request.

  • Status changed to Active 4 months ago
  • 🇦🇺Australia pameeela

    More info was provided here on the use case, I think this just needs a patch, if folks think this is worth doing. Perhaps it's a feature request though not a bug :)

Production build 0.71.5 2024