E2E auth-bypass for testing (production-safe)
AetherCut v1.5.1 shipped on May 2, 2026.
What's new in v1.5.1?
- Added opt-in
?e2e=1URL param +window.__AETHERCUT_E2E__flag for testing-agent flows — bypasses Google sign-in. - Triple-gated for safety: only activates on preview/localhost hostnames AND requires explicit opt-in — production aethercut.app is immune.
- 20 regression tests lock in the safety boundary (try every production hostname × every opt-in combination → all blocked)
- Fake user has no backend session, so even if bypass somehow activated, all real API calls (Stripe, YouTube, save) still 401.
A practical setup for reliable E2E auth bypass in local and preview environments
A good way to think about this feature is that it solves one very specific testing problem: getting the UI into an authenticated-looking state without dragging a third-party identity provider into every end-to-end run. In practice, that means your test runner can open the app, opt in to the bypass, and immediately exercise screens that would normally sit behind Google sign-in. The important boundary is that this is only about frontend access for test flows, not about creating a real account or a privileged session. That distinction matters when you design coverage. Use the bypass to test routing, conditional rendering, onboarding states, editor behavior, disabled buttons, and error handling around protected actions. Do not treat it as a substitute for a real authenticated integration path, because the fake user never receives a backend session. If your test expects a successful save, billing call, or YouTube-connected action, it should either mock that layer intentionally or use a separate path that signs in for real in an environment meant for that purpose.
A simple setup usually starts with your E2E runner enabling the bypass before the app boots. If your framework can inject script state before page code runs, set the global flag there so the app sees it on first render. If your framework works more naturally with navigation, append the opt-in query parameter when visiting the page. Using both together is often the most stable pattern in preview deployments, because it makes the test’s intent obvious and resilient across reloads. For example, one test might open a preview URL with the opt-in parameter, wait for the app shell to load, and verify that the signed-in UI appears without any Google popup or redirect. From there, it can navigate directly to the editor, confirm that user-specific chrome is visible, and assert that any action requiring a true server session fails in the expected way instead of hanging or silently succeeding. That last check is useful because it proves the boundary is working: the bypass grants enough identity to drive the interface, but not enough authority to mutate real backend state.
The most common mistake is enabling the bypass too late. If the app decides its auth state during initial load and your test sets the flag afterward, you can end up with flaky behavior where one run appears signed out and the next appears signed in after a refresh. The fix is not more waiting; it is making sure the opt-in is present before application initialization. Another frequent problem is writing assertions that are too broad. Seeing an avatar, account menu, or “signed in” label should not be interpreted as proof that downstream integrations are ready. Tests become brittle when they conflate “frontend believes there is a user” with “server trusts this browser.” Keep those checks separate. Assert the local authenticated UI state first, then assert that protected network actions are rejected when they should be. That gives you much clearer failures and prevents accidental false confidence.
Preview environments introduce a second class of mistakes: hardcoding assumptions about domains. Because the safety model depends on hostname plus explicit opt-in, tests should always use the actual preview URL surfaced by your deployment system instead of rewriting it through a generic base URL that may point somewhere else. If your CI platform creates multiple preview hostnames, pass the exact target into the test job and let the test append only the opt-in piece. This avoids the subtle failure mode where a test appears to be exercising a preview build but is really pointed at a production-like address where the bypass is correctly blocked. When that happens, teams sometimes misdiagnose it as a broken auth feature, when the real issue is that the safety gates are doing their job.
It also helps to be deliberate about which scenarios should use the bypass at all. Reach for it when authentication is incidental to the behavior you want to validate. If the point of the test is keyboard shortcuts in the editor, restoring draft UI, or navigating a signed-in layout, bypassing sign-in keeps the test focused and fast. If the point is account linking, session persistence, or the real permissions model, bypassing sign-in hides exactly the thing you need to verify. Splitting those concerns usually produces a healthier suite: a broad layer of stable E2E coverage using the bypass for product behavior, and a much smaller set of targeted auth integration tests that exercise the actual sign-in flow. That balance preserves confidence without letting external auth become the bottleneck for every pull request.
How do I get this update?
Open the editor and you have it. AetherCut runs in Chrome, Edge, Safari and Firefox. There is nothing to install, and you can edit without an account. Open the editor or see how it works.