v0 to Production: What to Review Before Shipping a Next.js 16 App
By Alvi Lika, Founder, Soatech
· · 9 min read
What v0 generates and provisions, what stays the app's responsibility, and the Next.js 16 checks to run before launch: patches, auth placement, caching, limits and headers.
v0 gives you a running Next.js application quickly, often with a database already attached. What it cannot decide for you is who may see which data, which actions need checks, and what the app does when something fails. Those decisions were always the application's job. They do not move to the generator because the generator wrote the first version.
This guide separates the two. First, what v0 produces and provisions. Then the checks that belong to your application before real users arrive, written for Next.js 16 as it stands in November 2026.
What v0 provides, and what it does not decide
From v0's documentation:
- Code. Full-stack applications on Next.js, Tailwind CSS and shadcn/ui, covering UI and backend logic.
- Data. Database integrations through the Vercel Marketplace (Neon, Supabase, Upstash, Vercel Blob). Adding one provisions an account on that service and adds the environment variables to your project. For SQL databases, v0 "can generate and execute SQL" to create, update and drop tables.
- Workflow. One-click deployment on Vercel, and pull requests for review.
The documentation does not describe v0 generating authentication rules, row-level security or tenant isolation for you. Treat anything it produced in those areas as a draft to review, not a design you can assume is complete.
| Provided by v0 and Vercel | Still the application's responsibility |
|---|---|
| Next.js project structure, components, styling | Deciding who may read and change each record |
| Provisioned database and environment variables | Reviewing the tables and SQL v0 created or ran |
| HTTPS hosting, preview deployments | Patching framework versions after launch |
| A first version of route handlers and actions | Authorization inside every Server Action and Route Handler |
| Webhook verification, retries, rate limits, error handling | |
| Tests that encode the rules above |
None of this is a criticism of v0. A generator that guessed your access rules would be worse than one that leaves them to you.
1. Pin a patched Next.js release, and keep patching
Framework vulnerabilities have nothing to do with how the app was generated, and they keep arriving. In 2026 alone:
- The May 2026 security release fixed 13 advisories, including middleware and proxy bypass, server-side request forgery, cache poisoning and cross-site scripting (patched in 15.5.18 and 16.2.6).
- The November 2026 security release (3 November) fixed seven more, including a High-severity cross-tenant cache disclosure. Patched versions are 16.4.5 (Active LTS) and 15.5.29 (Maintenance LTS).
Check: npm ls next react react-dom shows a version at or above the latest security release when you deploy. Someone is responsible for reading the Next.js blog and applying security releases within days.
2. Don't treat proxy.ts as your security boundary
Next.js 16 renamed middleware.ts to proxy.ts. It runs on the Node.js runtime and can't be switched to Edge. Generated code often puts its only authentication check there, as a redirect for signed-out users.
That is risky for two reasons. First, history: CVE-2025-29927 (March 2025) let attackers skip middleware entirely with an x-middleware-subrequest header, bypassing any authorization done there. It was fixed in 15.2.3, 14.2.25, 13.5.9 and 12.3.5, and deployments hosted on Vercel were protected automatically. Second, structure: proxy checks are page-level, while your data is reached through Server Actions, Route Handlers and Server Components.
The Next.js authentication guide says proxy "should not be your only line of defense" and recommends a Data Access Layer that checks the session next to the data:
// app/lib/dal.ts (simplified, adapted from the Next.js authentication guide)
import "server-only";
import { cache } from "react";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { decrypt } from "@/app/lib/session";
export const verifySession = cache(async () => {
const cookie = (await cookies()).get("session")?.value;
const session = await decrypt(cookie);
if (!session?.userId) redirect("/login");
return { userId: String(session.userId) };
});
// app/projects/actions.ts (simplified)
"use server";
import { verifySession } from "@/app/lib/dal";
import { sql } from "@/app/lib/db";
export async function renameProject(projectId: string, name: string) {
const { userId } = await verifySession();
// The ownership check is part of the write, not a separate step that can be skipped.
const rows = await sql`
update projects set name = ${name}
where id = ${projectId} and owner_id = ${userId}
returning id
`;
if (rows.length === 0) throw new Error("Not found");
}
Check: search for "use server" and export async function (GET|POST|PUT|PATCH|DELETE). Every match should verify the session and the caller's right to the specific record. Then run a two-account test: as user B, call an action or route with user A's record ID.
3. Validate input on the server
Server Actions are public HTTP endpoints. The arguments arrive from the client and can be anything. Parse them against a schema (Zod, Valibot or similar) before use, and check lengths and formats. Form validation in the browser is for user experience only.
4. Review what v0 created in the database
If v0 provisioned a database and ran SQL, read the schema it produced before real data goes in:
- Supabase: check RLS, policies and grants as described in the Supabase RLS testing guide. Run its anonymous count and two-account tests against your own project.
- Neon or another Postgres accessed from server code: isolation usually lives in your queries, as in the
owner_idcondition above. Confirm that every tenant-owned table has the tenant key and that every query in the data layer filters by it. If you add Postgres RLS on top, remember that table owners bypass it unless you useFORCE ROW LEVEL SECURITY(PostgreSQL docs), and the role your app connects as is often the owner.
Also check the migration story. SQL executed from a chat is not a migration history. Before launch, capture the schema as versioned migrations in the repository.
5. Keep per-user data out of shared caches
The November 2026 advisories are a good example of a risk generated code will not anticipate. Several involve Cache Components and use cache returning one tenant's or user's result to another under specific conditions. Patching fixes those bugs. The design rule stays the same either way: don't put per-user or per-tenant data in a shared cache unless the user or tenant is part of the cache key, and read the session outside the cached function. The Next.js guide on authentication with Cache Components covers the rules.
6. Secrets stay on the server
Anything prefixed NEXT_PUBLIC_ is compiled into browser JavaScript. Review that list by name. Import server-only in modules that read secrets, so an accidental client import fails the build. Environment variables added by a Marketplace integration are server-side unless they carry the public prefix. Check which ones do.
7. Webhooks verify signatures and handle duplicates
If v0 scaffolded a payment integration, check the webhook route. It should read the raw body with await req.text(), verify the signature with the provider's library, and record each event ID once before acting. Stripe documents that the same event can arrive more than once and that order is not guaranteed. A complete handler is in the Cursor security review checklist.
8. Rate-limit sign-in and expensive routes
Generated code rarely includes limits. Note that request.ip was removed from NextRequest in Next.js 15, so older snippets that use it are stale. On Vercel, use ipAddress from @vercel/functions:
// proxy.ts (simplified): limits only; authorization happens next to the data
import { NextResponse, type NextRequest } from "next/server";
import { ipAddress } from "@vercel/functions";
import { Ratelimit } from "@upstash/ratelimit";
import { Redis } from "@upstash/redis";
const ratelimit = new Ratelimit({
redis: Redis.fromEnv(),
limiter: Ratelimit.slidingWindow(10, "1 m"),
});
export async function proxy(request: NextRequest) {
const ip = ipAddress(request) ?? "unknown";
const { success } = await ratelimit.limit(`auth:${ip}`);
if (!success) return new NextResponse("Too many requests", { status: 429 });
return NextResponse.next();
}
export const config = { matcher: ["/api/auth/:path*"] };
IP-based limits are a first layer. For sign-in, also limit per account. For routes that call paid AI models, limit per user and set a spending cap with the provider. If your auth provider already rate-limits its own endpoints, confirm the setting instead of duplicating it.
9. Set security headers deliberately
Add headers in next.config.ts with headers(). X-Content-Type-Options: nosniff, Referrer-Policy and frame-ancestors 'none' (or X-Frame-Options: DENY) are easy wins. A Content Security Policy needs more thought. The Next.js CSP guide explains that a strict nonce-based policy requires dynamic rendering for every page. The alternative is a policy set in next.config.ts that allows 'unsafe-inline', or the experimental hash-based approach. Choose knowingly. Don't copy a policy with 'unsafe-eval' into production: the guide notes it is only needed in development.
Check: curl -sI https://your-app.example | grep -iE 'content-security|x-content-type|referrer|frame'.
10. Tests encode the rules, and previews are protected
At minimum: sign-in and sign-out, a protected page redirecting when signed out, the two-account test from item 2, and a duplicate-webhook test. Playwright works well for the browser flows. The two-account test can be a plain script against staging.
Preview deployments are real, reachable URLs. If previews connect to a database with real data, check your Vercel Deployment Protection settings so they are not open to anyone with the link.
When v0 is a good starting point
v0 output is already a Next.js App Router codebase. That matters if your production stack is Next.js: there is no framework migration before review can start, unlike a prototype that needs porting first. The remaining work is the list above. On a small app it is mostly review and tests. On an app with roles, shared workspaces and payments, it is a meaningful piece of engineering.
If you want that work done to a written baseline, see Prototype to Production. If you first need to know how big the gap is, start with a diagnosis.
Need to know what stands between your v0 app and launch?
Working on a feature this article touches? A 30-minute call is the quickest way to scope it.
Discuss your project