Too many redirects when logging into an access denied page

Created on 15 July 2025, 3 months ago

Problem/Motivation

If you log into a site, attempting to go to a page not found, like: /user/login?destination=/admin/people, you get a redirect error:
The page isn’t redirecting properly.

I believe this is because the navigation lock is trying to redirect too many times, and that we need to exit if the request is not the main request. I considered changing the priority, but I believe we still want access handling to kick in before the Legal page does?

Steps to reproduce

1. Turn on the Legal module
2. Attempt to log in with the destination set to a page you do not have access to (/user/login?destination=/admin/people)
3. Witness the too many redirects error

Proposed resolution

Only run logic on the kernel request event subscriber on the main request.

Remaining tasks

Apply the code fix.

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom littlepixiez

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

Comments & Activities

Production build 0.71.5 2024