Saved report · free to view

← Scan another repository

DEPLOYMENT REPORT

vercel/nextjs-subscription-payments

OVERALL RESULT1 issue to fix
YOUR NEXT MOVE · CONFIRMED FINDING1 / 6

Environment variables

.env.example

A complete file is suggested. Review the finding before changing anything.

Why this first?

Confirmed source findings come before review items, using this scan only. No code is changed automatically. Rescan after making changes.

What was checked? · 4 categories

Scanned: Next.js, Deployment, Env, Supabase

Ignored: Prisma/DB

Fixed (1)

New (5)

  • supabase/migrations/20230530034630_init.sql:5 public.users is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • supabase/migrations/20230530034630_init.sql:38 public.customers is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • supabase/migrations/20230530034630_init.sql:51 public.products is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • supabase/migrations/20230530034630_init.sql:74 public.prices is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • supabase/migrations/20230530034630_init.sql:106 public.subscriptions is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied

Ran in only one of the two scans, so not compared: Build configuration, Dependencies, Hardcoded secrets.

ENV

Fail
CHECK 06Breaks at runtime

Environment variables

2 env variables are missing from .env.example: NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE, STRIPE_SECRET_KEY_LIVE.

Why it works locally: Locally next dev reads your .env.local, which is never pushed. Vercel only has the variables you add under Project Settings, and NEXT_PUBLIC_ values are fixed at build time.
Show evidence (2)
  • ↳ NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE → missing from committed env template
  • ↳ STRIPE_SECRET_KEY_LIVE → missing from committed env template
Suggested fix: Add empty lines to .env.example in the repository root: NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE= + STRIPE_SECRET_KEY_LIVE=; push the file.
Review suggested .env.example
Complete .env.example
SUPABASE_AUTH_EXTERNAL_GITHUB_REDIRECT_URI="http://127.0.0.1:54321/auth/v1/callback"
SUPABASE_AUTH_EXTERNAL_GITHUB_CLIENT_ID=
SUPABASE_AUTH_EXTERNAL_GITHUB_SECRET=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE=
STRIPE_SECRET_KEY_LIVE=

SUPABASE

Review
CHECK 08Worth a look

Supabase server/client boundaries

5 tables have no Data API grants in the migrations and will answer 42501 once the automatic grants are gone.

Why it works locally: Locally you only test as yourself. In production every visitor holds the public anon key, and server code shares one process across all of them, so only server-only keys and row level security protect your data.
Show evidence (5)
  • ↳ supabase/migrations/20230530034630_init.sql:5 → public.users is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • ↳ supabase/migrations/20230530034630_init.sql:38 → public.customers is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • ↳ supabase/migrations/20230530034630_init.sql:51 → public.products is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • ↳ supabase/migrations/20230530034630_init.sql:74 → public.prices is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
  • ↳ supabase/migrations/20230530034630_init.sql:106 → public.subscriptions is created without a GRANT to anon, authenticated or service_role; Supabase is removing the automatic grants on new tables, and where that default applies the Data API answers 42501 permission denied
Suggested fix: Add a migration that grants only what each role needs, for example: grant select on table public.users to anon; grant select, insert, update, delete on table public.users to authenticated; grant select, insert, update, delete on table public.users to service_role; Keep row level security on: grants decide which roles reach the table, policies decide which rows.

Scan your private code for $2.

A 24-hour pass for public and private repository scans. Private code requires your GitHub authorization. One-time payment, no subscription, nothing renews.

Passed checks and scan coverage (6)
Launch checklist and scan limitations

Review the findings and coverage before launch. Runtime behavior and checkout were not tested.

Return to findings and available fixes ↑

Manual verification · not completed

Not verified

Checks performed

Did DeployDoctor solve it?

Come back after your next deploy and tell us. One click, no account.

Your next step

Exact files and steps are free. Copy them and apply the changes in your repository.

Get notified about new findings

Know when your next deploy is at risk

DeployDoctor rescans vercel/nextjs-subscription-payments once a day and emails you when something new breaks. Free, no account.

One email only when a scan finds something new, and every email has an unsubscribe link.

Share report or add to README

README badge

Shows this report's result in your README. It updates when you scan again and paste the new link.

DeployDoctor: 1 issue to fix[![DeployDoctor](https://deploydoctor.nyttolabs.com/r/c6edbb51-3f13-460c-b2f0-a0a981159f64/badge)](https://deploydoctor.nyttolabs.com/r/c6edbb51-3f13-460c-b2f0-a0a981159f64)

Latest repo status in your README

One link follows the latest public scan of the default branch, with its date and commit. Views never start scans.

Open repo status →[![DeployDoctor repo status](https://deploydoctor.nyttolabs.com/badge/vercel/nextjs-subscription-payments.svg)](https://deploydoctor.nyttolabs.com/score/vercel/nextjs-subscription-payments)

Scan button for your README

For templates and starters. The link points at this repository, so someone who forks it changes the owner/repo in the link to scan their own copy before the first deploy.

Scan with DeployDoctor[![Scan with DeployDoctor](https://deploydoctor.nyttolabs.com/badge.svg)](https://deploydoctor.nyttolabs.com/vercel/nextjs-subscription-payments)