Add Playwright E2E coverage and close the auth fail-open bypass#46
Draft
posthog[bot] wants to merge 1 commit into
Draft
Add Playwright E2E coverage and close the auth fail-open bypass#46posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
The web dashboard had zero end-to-end tests, and the Supabase auth middleware failed open: with the env vars missing it returned NextResponse.next() and skipped all route gating, so a prod deploy without those vars would quietly expose the dashboard. - Add Playwright to web/ (config boots `next dev`, `test:e2e` script) with first-phase specs covering the core dashboard flows: shell + empty state, mocked sessions rendering, row-click opening the drawer, the new-agent modal, and the import success/error toasts. Every /api/* route is mocked so nothing touches real Supabase, OAuth, or the vendor APIs. - Middleware now fails CLOSED when Supabase is unconfigured (redirect to /login), with an explicit, opt-in local-dev bypass (AUTH_DEV_BYPASS=true, honored only when NODE_ENV !== "production"). - Guard the client Supabase usage (UserMenu) so the UI still renders in the bypass/unconfigured state instead of crashing. - Document the env setup, auth behavior, and E2E workflow in the README. Generated-By: PostHog Code Task-Id: ebe3ffe9-61a2-4909-a679-755bf0f5d7ed
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
web/dashboard had zero end-to-end tests, and the Supabase auth middleware failed open: whenNEXT_PUBLIC_SUPABASE_URL/NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYwere missing it returnedNextResponse.next()and skipped all route gating — so a production deploy with those vars unset would quietly expose the dashboard instead of locking it down. The app is early-stage, which makes now the cheap time to lock in coverage and close the bypass.What changed
web/— config bootsnext dev, plustest:e2e/test:e2e:uiscripts. First-phase specs ine2e/cover the core dashboard flows: shell + empty state, mocked sessions rendering, row-click opening the drawer, the new-agent modal, and the import success/error toasts. Every/api/*route is mocked (seee2e/helpers.ts), so nothing touches real Supabase, OAuth, or the Claude/Jules/Cursor/Gemini vendor APIs./logininstead of passing through. An explicit, opt-in local-dev bypass (AUTH_DEV_BYPASS=true) is honored only whenNODE_ENV !== "production", so it can never re-open the gate in a real deploy.UserMenuno longer crashes the app when Supabase is unconfigured (the exact bypass scenario), so the UI still renders.Verification
/redirects to/login; dev withAUTH_DEV_BYPASS=true→/serves 200; dev without the bypass →/redirects to/login./loginstays reachable in every case.Created with PostHog Code from this inbox report.