Kill the Bill: Our $10,000 Challenge is on

Dec 9, 2025

Contributors

Fix navigation after authentication events

Ever been working in a dashboard only to suddenly find yourself back on the homepage? That frustrating experience is now fixed (and we are sorry). Let us make it up to you by explaining to you how it happened and how we figured it out.

Some of our end users reported an annoying issue: while working deep in the product, they would occasionally be unexpectedly redirected back to the Home page. No error, no explanation. Just... redirected to Home.

This bug had been haunting us on and off for a while. Somewhere in the chain of authentication refreshes and session handling, the app would sometimes route through "/" before restoring context. Our middleware would then dutifully add the organization parameter and send users on their way, but it had no memory of where they actually came from. The result? A one-way ticket back to the Home page.

We tried the traditional debugging approach: reading through code, adding breakpoints, sprinkling console.log statements everywhere, trying to reproduce locally. But the issue was intermittent and maddeningly hard to catch in the act.

Then we turned to Dash0 – as we always do.

We added custom logging to the middleware to capture the full context of each redirect: referrer headers, org parameters, request paths, and timing information. Once those logs were flowing into Dash0, the picture became clear almost immediately.

We could see the exact redirect patterns happening in production and trace the journey of affected requests. The culprit revealed itself: when a user was at /dashboards?org=acme and an auth refresh triggered, they'd hit “/” briefly, and our middleware had no idea they weren't supposed to be there.

The fix was straightforward once we understood the problem. When the middleware sees a request to "/" without an org parameter, it now checks if there’s any reference to where the user navigated from. If the user just came from a valid page on the same domain with a matching org, we send them right back instead of stranding them on the homepage.

This is one of the perks of building observability tooling. Having the right visibility helps us constantly improve and learn (even from these annoying bugs).