PR8: D11/D12/D13 — public /pricing + /api/health, tighten middleware#9
Open
Regantih wants to merge 1 commit into
Open
PR8: D11/D12/D13 — public /pricing + /api/health, tighten middleware#9Regantih wants to merge 1 commit into
Regantih wants to merge 1 commit into
Conversation
…matcher
D11 — app/pricing/page.tsx: real Free Trial → Pro pricing tiers, ToS link,
Sign-up and Subscribe CTAs. No fake data, no lorem ipsum.
D12 — app/api/health/route.ts: simplified to always-200 public endpoint
returning { status, commit, time }. Removed deep service pings
(those belonged on a future /api/health/deep route).
D13 — middleware.ts: added /pricing and /api/health to PUBLIC_PATH_PREFIXES
so the middleware never redirects them to /login. Updated comment
block to document the full public-path list.
|
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.
Summary
Three linked deliverables that make the marketing funnel and health-check endpoint work without requiring a login:
middleware.ts/pricingand/api/healthtoPUBLIC_PATH_PREFIXES; they now pass throughisPublicPath()and are never redirected to/loginapp/api/health/route.ts{ status, commit, time }. No Supabase/Anthropic pings (those belong on a future/api/health/deepbehind auth).app/pricing/page.tsx(new)/signup?plan=pro. No fake data.docs/BUILD_STATUS.mdRoot-cause diagnosis
Why
/api/healthredirected to/login(before this PR)Any unauthenticated request to
/api/healthhit!isPublicPath('/api/health') === true, triggeringNextResponse.redirect('/login?next=/api/health'). The route handler never ran.Why
/pricingredirected to/login(before this PR)Same cause —
/pricingwas not inPUBLIC_PATH_PREFIXES. Additionally,app/pricing/page.tsxdid not exist, so the route would have 404'd even if middleware had allowed it through.Changes (diff summary)
middleware.ts(D13)Matcher config and all auth logic unchanged — fix is additive only.
app/api/health/route.ts(D12)Removed Supabase and Anthropic deep pings. New shape — always HTTP 200:
{ "status": "ok", "commit": "d6ea6b6", "time": "2026-05-10T14:44:31.000Z" }export const dynamic = 'force-dynamic'retained so Vercel never serves a cached response.app/pricing/page.tsx(D11, new file)/signup/signup?plan=pro(Stripe wired onceSTRIPE_SECRET_KEYis set)LICENSEfile (real URL; dedicated/termspage is a tracked pending item)Vercel preview evidence
Preview URL: https://deallenz-git-pr8-public-route-8518c8-hemanths-projects-ac08a6f4.vercel.app
Vercel build status: ✅
success(DEPLOYED) — confirmed via GitHub commit status API at shad6ea6b6Vercel bot comment: Ready — deployment Awiv26h58
Manual verification commands (run from your local machine)
Acceptance criteria
GET /api/healthreturns HTTP 200 JSON, never 307/302GET /api/healthbody containsstatus,commit,timekeys/pricingrenders without redirect for unauthenticated users/pricingshows Free Trial and Pro plan cards/pricingincludes a Subscribe CTA (/signup?plan=pro) and a ToS link/dashboard,/api/upload, etc.) still redirect unauthenticated users to/logindocs/BUILD_STATUS.mdhas PR8 entryTest notes
package.jsonchanges — zero new dependenciesapp/pricing/page.tsximports onlynext/linkandnext(metadata) — both already in deps; no@/libimports so no server-only boundary riskapp/api/health/route.tsno longer imports@/lib/supabase/serveror@anthropic-ai/sdk— eliminates the risk of a 503 from unconfigured env vars during cold-start