A stranger cannot reach our 404 page, and three of our four error screens report to nobody
Try this against our site. Two URLs that do not exist, two different answers: curl -sI https://pub-trivia.app/guides/not-a-real-guide | head -1 # HTTP/2 404 curl -sI https://pub-trivia.app/not-a-real-guide | grep -iE "^(HTTP|location)" # location: /login?next=%2Fnot-a-real-guide Same site, same build, same nonsense path on the end. One gets our 404 page. The other gets a 307 to a login screen it…
A request sent to an invalid URL on the pub-trivia.app website yields different results depending on the path. While one URL receives a proper 404 error page, another triggers a redirect to a login screen. This discrepancy occurs because the site uses an auth gate that only allows public paths to pass through to the framework. If a path does not match any existing routes, it is treated as private and redirected to the login page with a next parameter, causing the user to potentially arrive at an incorrect location after signing in.
Four distinct error pages exist within the application, each designed to provide a unique message to users. The not-found.tsx page, which handles cases when a requested page does not exist, is the simplest with just 20 lines of code. It features a heading, a brief explanation, and a link back to the homepage. The global-error.tsx page, responsible for errors encountered at the root layout level, is more complex with 60 lines of code.
It includes inline styles and an error reporter that sends an Error ID when available. The dashboard/error.tsx and play/error.tsx pages are targeted at signed-in users experiencing issues within the app or on their phone while playing a game. These pages provide clearer context and instructions tailored to the user's specific situation, such as checking their connection or reloading the page.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.