App.js and FullCalendar returning 302

I get this issue sporadically and I don't know what causes it. If you see the attached screenshots, my scripts are returning a 302. I have had this happen locally a bunch but I just ignored it. Now it's happened in staging and I'm worried it will affect production when that starts up. The page is completely blank when this happens. I have to manually delete all cookies and then it works again (takes me back to login page - scripts return 200). But standard users won't know what to do when they see a completely blank page. Any ideas about what this could be? And why it only happens some of the time? Thanks!
16 Replies
Dennis Koch
Dennis Koch2y ago
Where are they redirecting? Maybe https vs http?
bwurtz999
bwurtz999OP2y ago
I'm not sure. I've already cleared the cookies so it's 'fixed' now and I can't see those details I should have checked... But this happens locally as well, which is all http At first I thought it might be an issue with the FullCalendar plugin But then I saw the app.js was also returning a 302 @Dennis Koch It happened again. app.js and filament-fullcalendar-scripts.js returning 302s. Do you have a minute to help? I don't even know what I should be looking for here What's weird is that livewire.js is working fine When I visit the full URL of the livewire asset, it loads as expected https://my-staging-environment.vapor-farm-g1.com/livewire/livewire.js?id=90730a3b0e7144480175 but it won't load for https://my-staging-environment.com/filament/assets/filament-fullcalendar-scripts.js or https://my-staging-environment.vapor-farm-g1.com/filament/assets/app.js?id=03a11a23dff55b7fe95e674320bd59ca https://my-staging-environment.vapor-farm-g1.com/filament/assets/app.js?id=03a11a23dff55b7fe95e674320bd59ca loads right now using a different browser Same exact URL, but one returns a redirect
Dennis Koch
Dennis Koch2y ago
Where is your t redirecting to?
bwurtz999
bwurtz999OP2y ago
Ok I think what I've figured out is that it has something to do with an authentication issue. When I try and visit an admin page and I'm not logged in, I get a 302 Found for the entire page returned. But when this issue happens I get a 302 for the specific asset I'm trying to load My t?
Dennis Koch
Dennis Koch2y ago
Sorry, where is it redirecting you 😅 To login I assume?
bwurtz999
bwurtz999OP2y ago
No.. that's what weird The location header is https://my-staging.com/admin But the page itself loads with a 200 *the location header from the 302 for the app.js
Dennis Koch
Dennis Koch2y ago
Do you use some custom middleware?
bwurtz999
bwurtz999OP2y ago
Yes I do. The location header is actually https://my-staging.com/airline. I use the multi context plugin and so it's redirecting to the base context URL But why would it return as unauthenticated for an asset but not the page itself?
Dennis Koch
Dennis Koch2y ago
Why do you think it’s unauthenticated? Maybe this is related to vapor?
bwurtz999
bwurtz999OP2y ago
Admittedly it's a guess, but I think that because when I clear cookies it gets fixed It happens locally too
Dennis Koch
Dennis Koch2y ago
Hm. I’d say get your hands dirty and step through the request with a debugger
bwurtz999
bwurtz999OP2y ago
Can you point me in the right direction? I've never done that before
Dennis Koch
Dennis Koch2y ago
Hard to explain and probably not the easiest task for your first time, sorry.
bwurtz999
bwurtz999OP2y ago
Alright thanks. Appreciate the guidance. I'll keep looking into it Posting this here for anyone who might find it helpful in the future. This was a custom middleware issue and that's what was causing the redirects Thank you @Dennis Koch for the help!
Dennis Koch
Dennis Koch2y ago
Which one was it?
bwurtz999
bwurtz999OP2y ago
It was a middleware that I added myself to the filament.php config file
Want results from more Discord servers?
Add your server