getPostLoginRedirection destination is ignored if destination query param is present

Created on 27 June 2023, about 1 year ago

Problem/Motivation

If another module has set the destination query parameter into the request stack, the redirect issued by getPostLoginRedirection fails, overridden by the destination.

Steps to reproduce

- Install https://www.drupal.org/project/login_destination β†’
- Configure a destination that redirects users to "/" after login
- Enable "Preserve the destination parameter" in the module settings (not sure whether this is required to reproduce or not)
- Do social login with ?destination parameter
- getPostLoginRedirection returns a RedirectResponse with the destination URL as expected
- The RedirectResponse is ignored when it is used, due to ?destination param in the query stack being equal to that of the destination configured in Login Destination

Proposed resolution

Set the destination param in the request stack when determining the destination redirect

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Needs review

Version

3.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mrweiner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024