Problem/Motivation
We have /user/login set as our 403 path. The form looks a bit broken because the frontend theme is used and not the admin theme.
The route name check is broken since the route name matches the main request, not the subrequest. Not sure if this is possible but raising :)
Steps to reproduce
system.site with
page:
403: /user/login
go to a 403 page
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3508338-13.png | 98.87 KB | phenaproxima |
| #6 | Screenshot 2025-09-19 at 7.11.36 am.png | 110.18 KB | pameeela |
| #4 | Screen Shot 2025-09-18 at 02.37.55.png | 3.14 MB | jwilson3 |
| #4 | Screen Shot 2025-09-18 at 02.37.26.png | 260.94 KB | jwilson3 |
| #4 | Screen Shot 2025-09-18 at 02.37.43.png | 103.69 KB | jwilson3 |
Issue fork gin_login-3508338
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pameeela commentedWe've hit this in the first Drupal CMS template, just realised I should check whether it's a gin_login issue :)
Comment #3
jwilson3Is this the same (or similar) issue as #3547364: Stylesheet missing on /user/register when 403? The steps to reproduce sound quite different, but maybe the MR I wrote there would work to solve this issue too? Please check! Thanks.
Comment #4
jwilson3I just tested on Gin Login 2.1.x branch with a clean standard Drupal 11 install (via ddev-drupal-contrib), but was unable to reproduce the issue. I also sanity checked same behavior on MR 48 for aforementioned issue #3547364, and saw no adverse impact.
Maybe this is something specific to do with Drupal CMS?
I'm attaching some screenshots as evidence that it works as designed with a clean standard Drupal 11 install:
✅ 403 page left empty
✅ 403 page set to /user/login
Comment #5
vinodhini.e commentedHi, Tested this on Drupal 11.2.3 with the Gin theme and Gin login enabled and /user/login set as the 403 page. As mentioned in the @wilson3 comment, after testing, the issue could not be reproduced — the login form rendered correctly and no broken layout was observed.
Could you provide more detailed steps to reproduce the issue?
Comment #6
pameeela commentedFWIW the original report is not about Drupal CMS :)
I believe the screenshot in #4 actually does show the problem, compare side by side with the form at
/user? The fields are weirdly indented and the page title is squished.Here is what it looks like in Drupal CMS, it is more obvious because of theme differences.

Comment #7
pameeela commentedDoes not appear to be the same as #3547364: Stylesheet missing on /user/register when 403. As noted in the OP, the issue is that the front end theme is loaded rather than the admin theme.
Comment #8
jwilson3Thanks for clarifications. So this is not the same issue as #3547364: Stylesheet missing on /user/register when 403, but its in the same vein and the fix there would likely be influenced in some way by a fix for this issue.
Comment #9
pameeela commentedI was able to take a look at this and unfortunately the other issue doesn't help with this one. Our problem is in
ThemeNegotiator, when the route match happens innegotiateRouteto determine whether to swap the theme, the match fails because it uses the original request route. Somewhere along the line the route changes to matchuser.loginso that's why everything else happens as expected later on, it just loads with the wrong theme.Comment #12
jurgenhaasFound a way to determine the route of the sub-request, this should resolve all similar issues.
Comment #13
phenaproximaManually tested !52 against vanilla core (11.3.x-dev). It didn't seem to work. What I did:
drush si -y && drush -y en gin_login, with !52 checked out/user/loginas the 403 page/admin/structureIt yielded this:
That looks Claro-ey, but not Gin-ey.
Comment #14
phenaproximaNever mind, I'm wrong! I had forgotten to set my admin theme to Gin. When I do that, it works fine!
Comment #15
phenaproximaThis is a Drupal CMS release target because it will let us remove a couple of annoying workarounds.
Comment #17
jurgenhaasThanks everyone, glad we got this sorted.