Closed (fixed)
Project:
Require Login
Version:
8.x-1.12
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jul 2018 at 14:26 UTC
Updated:
5 Jan 2019 at 04:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
heddnThis fixes the issue for me.
Comment #3
heddnComment #4
m.lebedev commentedHello.
It works. But... Next response have a not correct context and I again get a infinite redirect.
When I changed the LocalRedirectResponse on RedirectResponse, my problem fixed.
Thanks.
Comment #5
heddnRe #4: can you expound what you mean? I don't follow you? The destination should be to a local resource. It includes 'internal:' as the prefix. So pushing that into a LocalRedirectResponse should not have any problems, no?
Comment #6
m.lebedev commentedOk.

My steps:
From anonymous
1) Get /admin/structure/views
It's okay.

2) After that get /admin/people
It's not okay. I get the ERR_TOO_MANY_REDIRECTS.
This error is may solved in this way:
Before:
After:
Comment #7
heddnI cannot reproduce what you are seeing. Are you visiting multiple urls one, after another and it isn't working?
Comment #8
m.lebedev commentedYes, I am.
I could not determine the cause of the problem.
I checked on a clean installation of drupal and it works without problems.
But my current site has a problem. I was trying to find the cause, but failed.
As soon as there is time, I will try to fix it.
Comment #9
rymopatch #2 applies cleanly to 8.x-1.12 and fixes infinite redirect loop for non-anonymous paths on our production site. marking RTBC.
Comment #10
heddnI'm not able to reproduce the issue currently from #4/#6 currently, but off and on I am. And I think the reason is due to browser caching. Let's see if this fixes those outliers.
Comment #11
m.lebedev commented#10 I checked the patch. It solved my problem. Thanks.
Comment #12
Coops_#10 works a treat, thanks. Clear your cache if you run into issues after applying the patch.
Comment #13
rroblik commentedPatch #10 not working on my side (Drupal 8.6.2/require_login 8.x-1.12) ...Here is the fatal error :Patch applyed with composercweagans/composer-patchesAny idea ?
EDIT : simply apply cache rebuild after patching if you are in same situation !
Comment #14
heddnSeems like we have 2 corroborating testers of the patch in #10. So on to RTBC.
Comment #15
rymolike #13, I also had to rebuild cache to get past the "Too few arguments" error. should there be an update hook to eliminate that? this wasn't encountered with patch in #2.
Comment #16
heddnGood point. Needs an empty update hook to clear cache.
Comment #17
heddnTagging novice.
Comment #18
metzlerd commentedThe prior example in the module had a call to drupal's clear cache functionality so I replicated it. Happy to change that if necessary.
Comment #19
metzlerd commentedComment #20
nwoodland commentedPatch from #18 worked great against 1.12. Thanks everyone!
Comment #21
mstrelan commentedThis patch works great but all the rearranging of use statements means I can't also apply the patch from #3012100: URL parameters not preserved after login. The attached patch combines the two together.
Comment #22
bobooon commentedComment #23
bobooon commentedHttpExceptionSubscriberBase should be extended with an on403() method to handle redirects from normally access restricted pages. May have to rework EventSubscriberInterface to avoid stacked redirect responses that would totally defeat the fix.
Edit:
Should be able to use KernelEvents::EXCEPTION in getSubscribedEvents() instead of extending HttpExceptionSubscriberBase.
Comment #24
bobooon commentedIssue has been fixed in latest code refactor and has been committed to the 8.x-1.x branch. New releases will be created soon.
Thanks for working on this @metzlerd and @heddn. Though the patches weren't used the discussion shed light on some fundamental implementation flaws. I'm not going into much detail since a lot has changed in the refactor but the solution involved an additional event subscriber on KernelEvents::EXCEPTION.
Comment #25
bobooon commented