# Questions answered

> Canonical page: https://unbreakmyapp.vercel.app/questions.html

Every question answered on Unbreak My App fix pages, with the short answer and a link to the exact answer.

## Auth

### Do I need to change Google Cloud settings?

Only the authorised redirect URI, which should be the Supabase callback URL, not your site.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-auth-redirect-localhost.html#faq-do-i-need-to-change-google-cloud-settings

### Why localhost?

It's Supabase's default Site URL from when the project was created.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-auth-redirect-localhost.html#faq-why-localhost

### Does http vs https matter?

Yes, the URI must match exactly, including scheme and trailing slash.

Answer on: https://unbreakmyapp.vercel.app/fixes/oauth-redirect-uri-mismatch.html#faq-does-http-vs-https-matter

### Can I use wildcards?

No, Google requires exact redirect URIs.

Answer on: https://unbreakmyapp.vercel.app/fixes/oauth-redirect-uri-mismatch.html#faq-can-i-use-wildcards

### Is the session actually gone?

Usually not. The redirect fires before the session is restored.

Answer on: https://unbreakmyapp.vercel.app/fixes/session-lost-on-refresh.html#faq-is-the-session-actually-gone

### Why cookies for Next.js?

Server components and middleware can read cookies, not localStorage.

Answer on: https://unbreakmyapp.vercel.app/fixes/session-lost-on-refresh.html#faq-why-cookies-for-next-js

### Why do emails reach me but not my users?

The default Supabase SMTP only delivers to members of your project's organisation team. Everyone else gets 'Email address not authorized' until you add custom SMTP.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-auth-emails-not-sending.html#faq-why-do-emails-reach-me-but-not-my-users

### Can I just raise the default rate limit?

Not meaningfully. The built-in sender is for testing only. Custom SMTP is the fix, and then you can raise the limit on the Rate Limits page.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-auth-emails-not-sending.html#faq-can-i-just-raise-the-default-rate-limit

### Is there a free option?

Several providers, including Resend and Brevo, have free tiers that cover a small app's auth emails. Check their current limits before launch.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-auth-emails-not-sending.html#faq-is-there-a-free-option

### The email arrives but the link opens localhost.

That's a Site URL / redirect problem, not SMTP. See the Supabase auth redirect to localhost fix.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-auth-emails-not-sending.html#faq-the-email-arrives-but-the-link-opens-localhost

### Do I need all three: SPF, DKIM and DMARC?

Yes, in practice. Gmail and Yahoo require SPF or DKIM from everyone and all three for bulk senders, and DMARC is what makes the other two count for your From address.

Answer on: https://unbreakmyapp.vercel.app/fixes/transactional-emails-going-to-spam-spf-dkim-dmarc.html#faq-do-i-need-all-three-spf-dkim-and-dmarc

### Can I send from my @gmail.com address through Resend or SendGrid?

No. You can't add DNS records to gmail.com, so the mail fails DMARC and is likely to be filtered or rejected. Use a domain you own.

Answer on: https://unbreakmyapp.vercel.app/fixes/transactional-emails-going-to-spam-spf-dkim-dmarc.html#faq-can-i-send-from-my-gmail-com-address-through-resen

### Everything shows PASS but it still goes to spam.

Authentication is only the entry ticket. A new domain with no history, high complaint rates, spammy wording or link shorteners can still land in spam. Send steadily, only to people who asked for it, and check Google Postmaster Tools.

Answer on: https://unbreakmyapp.vercel.app/fixes/transactional-emails-going-to-spam-spf-dkim-dmarc.html#faq-everything-shows-pass-but-it-still-goes-to-spam

### Should I set DMARC to p=reject straight away?

No. Start with p=none and read the reports so you don't block your own legitimate mail (for example from Google Workspace or a billing tool), then tighten it.

Answer on: https://unbreakmyapp.vercel.app/fixes/transactional-emails-going-to-spam-spf-dkim-dmarc.html#faq-should-i-set-dmarc-to-p-reject-straight-away

### Is this why my Supabase confirmation emails never arrive?

Possibly, but first check you're not still on Supabase's built-in test SMTP, which only sends to your team and a few emails per hour. See the related fix on Supabase auth emails not sending.

Answer on: https://unbreakmyapp.vercel.app/fixes/transactional-emails-going-to-spam-spf-dkim-dmarc.html#faq-is-this-why-my-supabase-confirmation-emails-never-

### Am I affected if I do not have an Expo app?

The critical account takeover needs the expo() server plugin from @better-auth/expo registered on your server. If it is not there, that bug does not apply, but the same release fixed 11 other advisories across core and other plugins, so you should still upgrade every Better Auth package to 1.7.16.

Answer on: https://unbreakmyapp.vercel.app/fixes/better-auth-expo-account-takeover-below-1-7-16.html#faq-am-i-affected-if-i-do-not-have-an-expo-app

### Is upgrading enough?

Not if you used expo(). Signatures created before the fix stay valid until the application secret changes, so after upgrading you also need to rotate BETTER_AUTH_SECRET and redeploy. Some other plugins need data cleanup too; read the advisory for each plugin you use.

Answer on: https://unbreakmyapp.vercel.app/fixes/better-auth-expo-account-takeover-below-1-7-16.html#faq-is-upgrading-enough

### Will rotating the secret log my users out?

Expect it to. The secret signs sessions and verification links, so cookies and links signed with the old secret stop being trusted. Users sign in again; that is the point, since it also cancels anything an attacker forged.

Answer on: https://unbreakmyapp.vercel.app/fixes/better-auth-expo-account-takeover-below-1-7-16.html#faq-will-rotating-the-secret-log-my-users-out

### My app is on Vercel. Am I already protected?

Partly. Vercel says it added WAF rules that block the known exploit requests for projects it hosts, at no cost, but it also says not to rely on them: they cannot invalidate tokens forged earlier, and some of the other issues can only be fixed by upgrading.

Answer on: https://unbreakmyapp.vercel.app/fixes/better-auth-expo-account-takeover-below-1-7-16.html#faq-my-app-is-on-vercel-am-i-already-protected

### Which versions are patched?

better-auth and all @better-auth/* packages 1.7.16 on the stable line, and 1.8.0-beta.5 on the beta line. The affected @better-auth/expo range is 1.4.0-beta.6 up to (not including) 1.7.16, plus 1.8.0-beta.0 to 1.8.0-beta.4.

Answer on: https://unbreakmyapp.vercel.app/fixes/better-auth-expo-account-takeover-below-1-7-16.html#faq-which-versions-are-patched

### Is hiding the admin button or route enough to protect my admin page?

No. Hiding a link or redirecting in React only changes what the screen shows. Anyone can type the URL, change the JavaScript or call your API with curl. OWASP says access control is only effective in trusted server-side code. Check the admin role on the server and in your database rules on every request.

Answer on: https://unbreakmyapp.vercel.app/fixes/admin-page-hidden-but-not-protected-server-side-check.html#faq-is-hiding-the-admin-button-or-route-enough-to-prot

### How do I check if my admin page is really protected?

Open a private window logged out and go to /admin, then repeat as a normal user. Watch DevTools > Network for any response that contains other users' data, and call each admin API or Edge Function with curl using a normal user's token. Every request should return 401 or 403 with no data.

Answer on: https://unbreakmyapp.vercel.app/fixes/admin-page-hidden-but-not-protected-server-side-check.html#faq-how-do-i-check-if-my-admin-page-is-really-protecte

### Where should I store the admin role in Supabase?

In a separate table such as user_roles that normal users cannot write, or in app_metadata set from the server, optionally added to the JWT with a Custom Access Token Hook. Do not use user_metadata, because Supabase says the signed-in user can change it.

Answer on: https://unbreakmyapp.vercel.app/fixes/admin-page-hidden-but-not-protected-server-side-check.html#faq-where-should-i-store-the-admin-role-in-supabase

### Is Next.js middleware enough to protect /admin?

Not on its own. The Next.js docs say middleware (Proxy) should not be your only line of defense and that Server Actions need their own checks. Advisory CVE-2025-29927 also showed middleware-only authorization could be bypassed on unpatched self-hosted versions. Check the role again in the data access layer, Route Handlers and Server Actions.

Answer on: https://unbreakmyapp.vercel.app/fixes/admin-page-hidden-but-not-protected-server-side-check.html#faq-is-next-js-middleware-enough-to-protect-admin

### My admin page says 'not authorized' to normal users. Am I safe?

Only if the data never reaches them. Many AI-built admin pages download every user's data first and then hide it. If DevTools shows those rows in a response, Row Level Security or the API is letting the data out, and the message on the screen does not protect anything.

Answer on: https://unbreakmyapp.vercel.app/fixes/admin-page-hidden-but-not-protected-server-side-check.html#faq-my-admin-page-says-not-authorized-to-normal-users-

### Is a demo account in my app always a problem?

A demo account is fine if it has no admin rights, can only see demo data, and its password is not a secret anyone relies on. The problem is a test or admin account with a known password, or code that signs visitors in automatically, in the live app.

Answer on: https://unbreakmyapp.vercel.app/fixes/preview-auto-login-hardcoded-credentials-left-in-production.html#faq-is-a-demo-account-in-my-app-always-a-problem

### I removed the code. Is the test account still a risk?

Yes. The account still exists in Supabase Auth or your users table with the same password. Delete it in Authentication > Users or change it to a long unique password and remove any admin role. Supabase notes an access token already issued stays valid until it expires.

Answer on: https://unbreakmyapp.vercel.app/fixes/preview-auto-login-hardcoded-credentials-left-in-production.html#faq-i-removed-the-code-is-the-test-account-still-a-ris

### Does if (import.meta.env.DEV) keep my dev login out of production?

In Vite, yes: the docs say code inside if (import.meta.env.DEV) is tree-shaken in production builds. A custom flag like VITE_DEMO_MODE is different: its value and the code it guards are bundled, so anyone can read it and often switch it on.

Answer on: https://unbreakmyapp.vercel.app/fixes/preview-auto-login-hardcoded-credentials-left-in-production.html#faq-does-if-import-meta-env-dev-keep-my-dev-login-out-

### Can people really see passwords in my front-end code?

Yes. Vite and Next.js copy VITE_ and NEXT_PUBLIC_ values into the JavaScript sent to the browser, and any string typed into front-end code is there too. Open DevTools > Sources on your live site and search: if you can find it, so can anyone.

Answer on: https://unbreakmyapp.vercel.app/fixes/preview-auto-login-hardcoded-credentials-left-in-production.html#faq-can-people-really-see-passwords-in-my-front-end-co

### Is it enough to delete the password from my GitHub repo?

No. Change or rotate the password or key first. GitHub's guide says revoking or rotating the secret is the first step, and old commits can still exist in forks and clones after you rewrite history.

Answer on: https://unbreakmyapp.vercel.app/fixes/preview-auto-login-hardcoded-credentials-left-in-production.html#faq-is-it-enough-to-delete-the-password-from-my-github

### Why doesn't a per-email login limit stop credential stuffing?

Because credential stuffing tries each leaked email and password pair once, often from many IP addresses. Each account sees only one or two failures, so a counter per email never reaches its limit. OWASP recommends layers: MFA first, then CAPTCHA, IP checks and leaked password blocking.

Answer on: https://unbreakmyapp.vercel.app/fixes/login-rate-limit-only-per-email-credential-stuffing.html#faq-why-doesn-t-a-per-email-login-limit-stop-credentia

### Does Supabase rate limit password sign-ins?

Yes, per IP address. The /auth/v1/token endpoint used for password sign-in defaults to 150 requests per 5 minutes with bursts up to 30, and you can change it under Authentication > Rate Limits. Over the limit Supabase returns 429 over_request_rate_limit. It is per IP, so it does not stop an attack spread over many IPs.

Answer on: https://unbreakmyapp.vercel.app/fixes/login-rate-limit-only-per-email-credential-stuffing.html#faq-does-supabase-rate-limit-password-sign-ins

### Why do all my users get over_request_rate_limit at once?

Your server is probably calling Supabase Auth for everyone, so Supabase sees one IP address. Enable IP Address Forwarding in Authentication > Rate Limits and send the user's IP in the Sb-Forwarded-For header, which Supabase only accepts with a secret key used on the server.

Answer on: https://unbreakmyapp.vercel.app/fixes/login-rate-limit-only-per-email-credential-stuffing.html#faq-why-do-all-my-users-get-over-request-rate-limit-at

### Should I lock accounts after 5 failed logins?

Not permanently. OWASP warns that lockouts can be used to lock out real users on purpose. Prefer a CAPTCHA or a growing delay after a few failures, keep the forgot password flow working, and use MFA for real protection.

Answer on: https://unbreakmyapp.vercel.app/fixes/login-rate-limit-only-per-email-credential-stuffing.html#faq-should-i-lock-accounts-after-5-failed-logins

### Is leaked password protection free on Supabase?

Supabase's built-in leaked password protection, which uses HaveIBeenPwned's Pwned Passwords, is on the Pro plan and above. The Pwned Passwords range API itself is free with no API key, so on the Free plan you can check new passwords from your own server.

Answer on: https://unbreakmyapp.vercel.app/fixes/login-rate-limit-only-per-email-credential-stuffing.html#faq-is-leaked-password-protection-free-on-supabase

### Doesn't verify_jwt mean only logged-in users can call my Edge Function?

No. It only checks that the Authorization header carries a token the platform accepts. The legacy anon key is a valid long-lived JWT, and for migration compatibility the check also accepts publishable and secret keys. Supabase says passing the check does not authenticate the caller, so check for a real user inside the function.

Answer on: https://unbreakmyapp.vercel.app/fixes/edge-function-callable-by-anyone-anon-key-is-a-jwt.html#faq-doesn-t-verify-jwt-mean-only-logged-in-users-can-c

### Is the Supabase anon key a JWT?

Yes. Supabase's API keys guide lists anon and service_role as legacy long-lived JWTs. The newer publishable (sb_publishable_) and secret (sb_secret_) keys are short strings, not JWTs, and belong in the apikey header.

Answer on: https://unbreakmyapp.vercel.app/fixes/edge-function-callable-by-anyone-anon-key-is-a-jwt.html#faq-is-the-supabase-anon-key-a-jwt

### How do I make an Edge Function only work for signed-in users?

Wrap it with withSupabase({ auth: 'user' }) from @supabase/server, which accepts only a valid user JWT and gives you the user's claims and an RLS-scoped client. In older createClient code, call supabase.auth.getUser() with the token from the Authorization header and return 401 when there is no user.

Answer on: https://unbreakmyapp.vercel.app/fixes/edge-function-callable-by-anyone-anon-key-is-a-jwt.html#faq-how-do-i-make-an-edge-function-only-work-for-signe

### Can someone call my Edge Function from outside my app?

Yes. Your project URL and anon or publishable key are in your frontend bundle by design, so anyone can copy them and call the function with curl. Treat every function as a public URL and authorize the caller in code.

Answer on: https://unbreakmyapp.vercel.app/fixes/edge-function-callable-by-anyone-anon-key-is-a-jwt.html#faq-can-someone-call-my-edge-function-from-outside-my-

### Should I turn verify_jwt off?

Only for functions that are called without a user token, such as Stripe webhooks (verify the signature instead) or cron jobs (require a secret key). Keep it on for user-facing functions, but do not rely on it alone.

Answer on: https://unbreakmyapp.vercel.app/fixes/edge-function-callable-by-anyone-anon-key-is-a-jwt.html#faq-should-i-turn-verify-jwt-off

### Why was my OpenAI or email Edge Function spammed?

If the function only relies on verify_jwt, anyone with your public key can call it in a loop. Require a signed-in user, add a per-user rate limit and set spending limits on the paid API.

Answer on: https://unbreakmyapp.vercel.app/fixes/edge-function-callable-by-anyone-anon-key-is-a-jwt.html#faq-why-was-my-openai-or-email-edge-function-spammed


## Payments

### Which secret do I use locally?

The whsec_ printed by stripe listen. In production use the endpoint's secret from the Dashboard.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-signature-failed.html#faq-which-secret-do-i-use-locally

### Test vs live?

Each mode and each endpoint has its own signing secret.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-signature-failed.html#faq-test-vs-live

### Can I trust the success URL?

No. Treat it as a thank-you page only; grant access from the webhook.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-payment-succeeds-but-app-not-updated.html#faq-can-i-trust-the-success-url

### Payment Links?

They support client_reference_id via a URL parameter too.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-payment-succeeds-but-app-not-updated.html#faq-payment-links

### Can I copy test products to live?

Yes, the Dashboard has a 'Copy to live mode' option for products.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-test-vs-live-keys.html#faq-can-i-copy-test-products-to-live

### Is it a code bug?

Usually not; it's a key/ID mismatch.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-test-vs-live-keys.html#faq-is-it-a-code-bug

### Is it a Stripe bug that events arrive twice?

No. Stripe documents that endpoints may occasionally receive the same event more than once, so handlers must ignore events they've already processed.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-duplicate-events-double-charge.html#faq-is-it-a-stripe-bug-that-events-arrive-twice

### Webhook duplicates vs real double charges?

Duplicate events just re-run your code for one payment. A real double charge means two payments were created, usually from a double-clicked button or a retried create call without an idempotency key.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-duplicate-events-double-charge.html#faq-webhook-duplicates-vs-real-double-charges

### How do I test it?

Use stripe events resend <event_id> (or Resend in the Dashboard) and confirm the second delivery is skipped.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-duplicate-events-double-charge.html#faq-how-do-i-test-it

### Isn't Stripe Checkout secure already?

Stripe's payment page is secure, but it charges whatever your server tells it to. If your server copies the amount from the browser, the customer is choosing the price.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-checkout-price-from-client-tampering.html#faq-isn-t-stripe-checkout-secure-already

### Can I just validate the amount on the server?

You can, but it's easier and safer to use Price IDs from Stripe and never accept an amount at all. Then there's nothing to validate.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-checkout-price-from-client-tampering.html#faq-can-i-just-validate-the-amount-on-the-server

### What about pay-what-you-want or donations?

Use Stripe's customer-chosen price option on a Price, or enforce a server-side minimum and maximum, and still never trust other fields from the browser.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-checkout-price-from-client-tampering.html#faq-what-about-pay-what-you-want-or-donations

### How do I know if someone already did this?

Filter Payments in the Stripe Dashboard by amount and compare against your real prices, and check your webhook logs for sessions whose amount_total doesn't match a known plan.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-checkout-price-from-client-tampering.html#faq-how-do-i-know-if-someone-already-did-this

### Can't I just check the session_id on the success page?

You can retrieve the session on the server to show a nicer message, but you still need the webhook, because many customers never reach the success page and delayed payment methods aren't paid yet when they do.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-success-page-grants-access-without-webhook.html#faq-can-t-i-just-check-the-session-id-on-the-success-p

### Why does it work in my testing but not for real customers?

In testing you always wait for the redirect. Real customers close tabs, lose signal or use bank payments that settle later, so a success-page-only flow silently misses paid users.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-success-page-grants-access-without-webhook.html#faq-why-does-it-work-in-my-testing-but-not-for-real-cu

### Will the webhook arrive before the success page loads?

Not always. Show a short 'unlocking your account' state and poll your database, or retrieve the session server-side, so the page handles both orders.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-success-page-grants-access-without-webhook.html#faq-will-the-webhook-arrive-before-the-success-page-lo

### Do I need the webhook for one-time payments too?

Yes. The same rule applies to one-off purchases, credits and lifetime deals: fulfil from checkout.session.completed after verifying the signature.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-success-page-grants-access-without-webhook.html#faq-do-i-need-the-webhook-for-one-time-payments-too

### Will Stripe disable my endpoint?

If live deliveries keep failing, Stripe emails you a warning with a date and can disable the endpoint so it stops receiving events. Fix the failures before that date, or re-enable after you fix them.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-failing-email-endpoint-will-be-disabled.html#faq-will-stripe-disable-my-endpoint

### Does re-enabling replay missed events?

No. Re-enabling only starts delivery of new events. Backfill failed ones with the Events API (delivery_success=false, last 30 days) or by using Resend on individual events, and make your handler idempotent.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-failing-email-endpoint-will-be-disabled.html#faq-does-re-enabling-replay-missed-events

### How long does Stripe keep retrying?

In live mode Stripe retries for up to about 3 days with exponential backoff. In a sandbox it retries a few times over a few hours. You still get the failing-endpoint email when responses stay outside 2xx.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-failing-email-endpoint-will-be-disabled.html#faq-how-long-does-stripe-keep-retrying

### Why did it work in test and fail in live?

Live mode needs its own endpoint URL and its own whsec_ secret. A test-mode secret, a localhost URL, or a preview deploy URL will fail once real payments start.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-failing-email-endpoint-will-be-disabled.html#faq-why-did-it-work-in-test-and-fail-in-live

### Is returning 200 for every request safe?

Return 2xx only after you have accepted the event (signature checked, event id recorded). Returning 200 for a bad signature hides attacks; returning non-2xx for a valid event you already processed causes endless retries. Skip duplicates and still return 200.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-failing-email-endpoint-will-be-disabled.html#faq-is-returning-200-for-every-request-safe

### Why does my Stripe webhook get 401 from Supabase?

Supabase Edge Functions check for a valid Supabase JWT before your code runs, and that check is on by default. Stripe does not have your users' tokens, so every delivery fails with 'Missing authorization header' or 'Invalid JWT'. Disable verify_jwt for the webhook function and verify the Stripe signature in code instead.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-401-supabase-edge-function-jwt-verification.html#faq-why-does-my-stripe-webhook-get-401-from-supabase

### Is it safe to set verify_jwt = false?

For a webhook, yes, if your code verifies the Stripe-Signature header with your whsec_ secret and rejects anything that fails. Supabase's docs recommend exactly this for external webhooks. Without signature verification, anyone could call the URL and fake a payment, so never skip that step.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-401-supabase-edge-function-jwt-verification.html#faq-is-it-safe-to-set-verify-jwt-false

### Can I add my anon or service_role key to the Stripe webhook instead?

No. Stripe proves who it is with its own Stripe-Signature header, not your Supabase keys, and putting a service_role or secret key in a URL leaks full database access to anyone who sees it. Turn the JWT check off for that function and use Stripe's signature.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-401-supabase-edge-function-jwt-verification.html#faq-can-i-add-my-anon-or-service-role-key-to-the-strip

### Will I lose the payments that failed while it returned 401?

Not if you act within the retry window. Stripe retries live deliveries for up to three days, and you can resend an event from the Dashboard for up to 15 days or with the Stripe CLI for up to 30 days. After fixing, resend the failed events and check each customer's account.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-401-supabase-edge-function-jwt-verification.html#faq-will-i-lose-the-payments-that-failed-while-it-retu

### I turned it off but still get 401. Why?

Either a later deploy turned the check back on (keep verify_jwt = false in supabase/config.toml), you changed a different function than the one in Stripe's endpoint URL, or the 401 now comes from your own code. Check the response body: a Supabase message means the platform check, your own message means your code.

Answer on: https://unbreakmyapp.vercel.app/fixes/stripe-webhook-401-supabase-edge-function-jwt-verification.html#faq-i-turned-it-off-but-still-get-401-why


## Deploys

### Can I set ignoreBuildErrors?

It ships, but hides real bugs. Use it only as a temporary stopgap.

Answer on: https://unbreakmyapp.vercel.app/fixes/vercel-build-failed-type-errors.html#faq-can-i-set-ignorebuilderrors

### Why does casing matter?

Vercel builds on Linux, which has a case-sensitive filesystem.

Answer on: https://unbreakmyapp.vercel.app/fixes/vercel-build-failed-type-errors.html#faq-why-does-casing-matter

### Why does the home page work?

/ maps to index.html, which exists; other paths don't.

Answer on: https://unbreakmyapp.vercel.app/fixes/vercel-404-on-refresh-spa.html#faq-why-does-the-home-page-work

### Will this break API routes?

Vercel serves real files and functions before applying rewrites.

Answer on: https://unbreakmyapp.vercel.app/fixes/vercel-404-on-refresh-spa.html#faq-will-this-break-api-routes

### Why does it work in Postman?

CORS is enforced by browsers only.

Answer on: https://unbreakmyapp.vercel.app/fixes/cors-error-fetch-blocked.html#faq-why-does-it-work-in-postman

### Can I use Access-Control-Allow-Origin: *?

Only for public, credential-free endpoints.

Answer on: https://unbreakmyapp.vercel.app/fixes/cors-error-fetch-blocked.html#faq-can-i-use-access-control-allow-origin

### Why does it work in the workspace?

The workspace preview is more forgiving about host and port.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-port-not-open.html#faq-why-does-it-work-in-the-workspace

### Where do env vars go?

Replit Secrets.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-port-not-open.html#faq-where-do-env-vars-go

### Is suppressHydrationWarning a fix?

Only for single intentional mismatches like timestamps.

Answer on: https://unbreakmyapp.vercel.app/fixes/nextjs-hydration-mismatch.html#faq-is-suppresshydrationwarning-a-fix

### Could an extension cause it?

Yes, try incognito.

Answer on: https://unbreakmyapp.vercel.app/fixes/nextjs-hydration-mismatch.html#faq-could-an-extension-cause-it

### How long should Verifying take?

Often minutes to a few hours. Lovable marks it 'Unable to verify' after an hour, but DNS propagation can take up to 72 hours, so check the records are right and then wait rather than re-adding the domain.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-custom-domain-stuck-verifying.html#faq-how-long-should-verifying-take

### Do I need to buy an SSL certificate from my registrar?

No. Lovable issues its own certificate for connected domains. A certificate bought at your registrar isn't used.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-custom-domain-stuck-verifying.html#faq-do-i-need-to-buy-an-ssl-certificate-from-my-regist

### My domain shows my old website.

Old A, AAAA or CNAME records for the same host are still in your DNS. Remove them so only Lovable's A record and the _lovable TXT record remain.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-custom-domain-stuck-verifying.html#faq-my-domain-shows-my-old-website

### Why does login work on lovable.app but not my domain?

Your auth provider only trusts redirect URLs it knows. Add the new domain to your Supabase redirect URLs and any OAuth client, or see the Supabase auth redirect to localhost fix for the same class of problem.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-custom-domain-stuck-verifying.html#faq-why-does-login-work-on-lovable-app-but-not-my-doma

### Do custom domains need a paid plan?

Yes. Lovable says custom domains are available on paid plans.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-custom-domain-stuck-verifying.html#faq-do-custom-domains-need-a-paid-plan

### Why does the preview work if production doesn't?

The preview runs a dev server with your local environment and lenient settings. Production is a fresh build on someone else's server with only the settings you've added to the hosting dashboard.

Answer on: https://unbreakmyapp.vercel.app/fixes/works-on-localhost-breaks-in-production.html#faq-why-does-the-preview-work-if-production-doesn-t

### I added the environment variable and it still says undefined.

Frontend variables are baked in at build time, so you need to redeploy after adding them, and the name must have the right public prefix (VITE_ for Vite apps, NEXT_PUBLIC_ for Next.js).

Answer on: https://unbreakmyapp.vercel.app/fixes/works-on-localhost-breaks-in-production.html#faq-i-added-the-environment-variable-and-it-still-says

### The browser just says 500 or 'Internal Server Error'.

The details are in your host's server or function logs, not the browser. Open the logs for that deployment and look at the timestamp when you reproduced it.

Answer on: https://unbreakmyapp.vercel.app/fixes/works-on-localhost-breaks-in-production.html#faq-the-browser-just-says-500-or-internal-server-error

### Should I just copy my whole .env into production?

Copy only what production needs, use production values (live keys, the real domain), and never expose secret keys with a public prefix.

Answer on: https://unbreakmyapp.vercel.app/fixes/works-on-localhost-breaks-in-production.html#faq-should-i-just-copy-my-whole-env-into-production

### Why does my security scan say my vibe-coded app is missing a Content-Security-Policy?

Because CSP is an HTTP response header set by your server or host, not by the app code your AI builder wrote, and most default deploys do not send one. Add it on the host (vercel.json, Netlify _headers or next.config.js), starting with Content-Security-Policy-Report-Only so you can see what it would block before enforcing it.

Answer on: https://unbreakmyapp.vercel.app/fixes/missing-security-headers-csp-vercel-netlify.html#faq-why-does-my-security-scan-say-my-vibe-coded-app-is

### Which security headers should I add first?

The low-risk ones: X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, X-Frame-Options: DENY and a Permissions-Policy that turns off camera, microphone and geolocation if you do not use them. These are OWASP's recommended values. CSP needs testing, so add it in report-only mode first.

Answer on: https://unbreakmyapp.vercel.app/fixes/missing-security-headers-csp-vercel-netlify.html#faq-which-security-headers-should-i-add-first

### Do I need to add Strict-Transport-Security (HSTS) on Vercel?

Usually not. Vercel's docs say *.vercel.app domains send HSTS automatically and are preloaded, and custom domains get HSTS for that subdomain. You can set your own header if you want includeSubDomains or preload on a custom domain.

Answer on: https://unbreakmyapp.vercel.app/fixes/missing-security-headers-csp-vercel-netlify.html#faq-do-i-need-to-add-strict-transport-security-hsts-on

### I added a CSP and now my app is blank. What happened?

The policy is blocking scripts or requests your app needs, often inline scripts, Supabase, Stripe or analytics. Open the console to see each 'Refused to load' message, switch the header to Content-Security-Policy-Report-Only while you fix them, add only the exact domains you use, and move inline scripts to files or nonces instead of adding 'unsafe-inline'.

Answer on: https://unbreakmyapp.vercel.app/fixes/missing-security-headers-csp-vercel-netlify.html#faq-i-added-a-csp-and-now-my-app-is-blank-what-happene

### Can I set a CSP with a meta tag instead of a header?

Partly. A <meta http-equiv> CSP works for most directives, but MDN notes frame-ancestors and the Content-Security-Policy-Report-Only header are not supported in a meta element, so clickjacking protection and report-only testing need real HTTP headers.

Answer on: https://unbreakmyapp.vercel.app/fixes/missing-security-headers-csp-vercel-netlify.html#faq-can-i-set-a-csp-with-a-meta-tag-instead-of-a-heade

### What does 502 Bad Gateway mean on a Replit app?

It means Replit's proxy could not get a valid response from your app's server. After a republish that usually means the new version crashed on startup, is listening on the wrong address or port, or is too slow to answer. Check the deploy logs first.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-publish-502-bad-gateway-after-republish.html#faq-what-does-502-bad-gateway-mean-on-a-replit-app

### Why does my Replit app work in Preview but not when published?

Preview and the published app run differently. The published app needs to listen on 0.0.0.0, use a single exposed port, use production run and build commands and have its own production secrets, and its file system resets on every publish. Replit's troubleshooting guide covers each of these.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-publish-502-bad-gateway-after-republish.html#faq-why-does-my-replit-app-work-in-preview-but-not-whe

### Why does Replit publishing fail at the last step?

Before switching your URL to the new version, Replit sends it a request. If the homepage takes more than about five seconds, or the server is not listening on the expected port, the check fails and the publish stops at the final Promote stage. Start the server first and keep the / route fast.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-publish-502-bad-gateway-after-republish.html#faq-why-does-replit-publishing-fail-at-the-last-step

### Can I roll back a Replit deployment to the previous version?

Not with one click. Replit says you are responsible for tracking tested, healthy releases. Roll back the code to the checkpoint or Git commit from your last good publish (look for Published your App commits) and publish again. Rolling back code does not change your production database.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-publish-502-bad-gateway-after-republish.html#faq-can-i-roll-back-a-replit-deployment-to-the-previou

### Could the 502 be Replit's fault?

Sometimes, but check your own app first: if Preview works and the deploy logs show your server crashing or not listening, it is the app. If the logs look healthy, the app fails on every network and nothing changed, check Replit's status page and contact Replit Support with your Deployment ID.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-publish-502-bad-gateway-after-republish.html#faq-could-the-502-be-replit-s-fault


## Database / Supabase RLS

### Should I just turn RLS off?

No. With RLS off, anyone holding your public anon key can read and write the whole table. Add policies instead.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-empty-results.html#faq-should-i-just-turn-rls-off

### Why does it work in the SQL editor?

The SQL editor runs as the postgres role, which bypasses RLS.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-empty-results.html#faq-why-does-it-work-in-the-sql-editor

### Can I use the service_role key in the browser to bypass this?

Never. The service_role key bypasses all RLS and must only live on a server.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-new-row-violates-policy.html#faq-can-i-use-the-service-role-key-in-the-browser-to-b

### What is WITH CHECK?

The condition new or changed rows must satisfy; USING filters existing rows.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-new-row-violates-policy.html#faq-what-is-with-check

### Where are the logs?

Supabase Dashboard → Edge Functions → the function → Logs.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-supabase-edge-function-cors.html#faq-where-are-the-logs

### Does it need my anon key?

supabase.functions.invoke sends it automatically.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-supabase-edge-function-cors.html#faq-does-it-need-my-anon-key

### The bucket is public, why 403?

Public only affects downloads; uploads still need policies.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-storage-upload-403.html#faq-the-bucket-is-public-why-403

### How do I restrict to own folder?

Use (storage.foldername(name))[1] = auth.uid()::text in the policy.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-storage-upload-403.html#faq-how-do-i-restrict-to-own-folder

### The table is in my code / types. Why fail?

Types and UI don't create database objects; only a migration or SQL run does.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-relation-does-not-exist.html#faq-the-table-is-in-my-code-types-why-fail

### It works for my teammate.

They likely ran the migration on their project, or you're using different SUPABASE_URL values.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-relation-does-not-exist.html#faq-it-works-for-my-teammate

### My old tables still work. Why only this one?

Only tables created after the change lose automatic grants; existing tables keep theirs.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-permission-denied-for-table.html#faq-my-old-tables-still-work-why-only-this-one

### I'm using the service role key and it still fails.

service_role needs a grant too. Without one, PostgREST denies it before RLS runs.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-permission-denied-for-table.html#faq-i-m-using-the-service-role-key-and-it-still-fails

### Is this the same as 'new row violates row-level security policy'?

No. That's also 42501 but means a policy blocked the row; a missing grant includes a GRANT hint.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-permission-denied-for-table.html#faq-is-this-the-same-as-new-row-violates-row-level-sec

### Does this affect direct Postgres connections?

No, only the Data API (supabase-js, REST, GraphQL). ORMs over a connection string are unaffected.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-permission-denied-for-table.html#faq-does-this-affect-direct-postgres-connections

### Is the anon key the problem?

No. The anon key is designed to be public. The problem is missing RLS (or missing policies) so PostgREST allows unrestricted access.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-disabled-table-public.html#faq-is-the-anon-key-the-problem

### Will enabling RLS break my app?

Yes, temporarily: once RLS is on with no policies, queries return empty or fail until you add matching policies. Add the policies in the same migration.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-disabled-table-public.html#faq-will-enabling-rls-break-my-app

### Why is there no error?

Postgres treats 'no rows matched' as a successful update of 0 rows. RLS filters out rows you can't see before the update runs, so there's nothing to report as an error.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-update-saved-but-gone-after-refresh.html#faq-why-is-there-no-error

### I added an UPDATE policy and it still doesn't save.

Add a SELECT policy for the same rows too. Without it, the update can't see the row it's meant to change.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-update-saved-but-gone-after-refresh.html#faq-i-added-an-update-policy-and-it-still-doesn-t-save

### Inserts work, so why not updates?

Insert, select, update and delete each need their own policy. An INSERT policy says nothing about updates.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-update-saved-but-gone-after-refresh.html#faq-inserts-work-so-why-not-updates

### Is the service role key a fix?

Only on a trusted server. In the browser it bypasses all security, so anyone could edit anyone's data. See the leaked service role key fix.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-update-saved-but-gone-after-refresh.html#faq-is-the-service-role-key-a-fix

### RLS is enabled, so why can other users see my data?

Enabling RLS only blocks access that no policy allows. A policy like USING (true) or auth.uid() IS NOT NULL allows every request, or every signed-in request, so the table is effectively open.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-policy-using-true-any-user-can-read.html#faq-rls-is-enabled-so-why-can-other-users-see-my-data

### Isn't TO authenticated enough to keep strangers out?

Only if strangers can't create accounts. In most apps anyone can sign up, so authenticated means anyone on the internet who spends ten seconds registering.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-policy-using-true-any-user-can-read.html#faq-isn-t-to-authenticated-enough-to-keep-strangers-ou

### Why did my owner-only policy not help?

Postgres combines permissive policies with OR. If any one policy on the table says true, the row is visible, so you have to drop the broad policy, not just add a stricter one.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-policy-using-true-any-user-can-read.html#faq-why-did-my-owner-only-policy-not-help

### Is USING (true) ever fine?

Yes, for SELECT on data that is meant to be public to everyone, like published blog posts or a product catalogue. It is never fine for insert, update or delete, or for tables with private user data.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-rls-policy-using-true-any-user-can-read.html#faq-is-using-true-ever-fine

### What does 'Edge Function returned a non-2xx status code' actually mean?

It means the function, or the Supabase gateway in front of it, answered with an error status (4xx or 5xx). supabase-js uses this one generic message for every error status and puts the real Response on error.context, so read error.context.status and its body to see what went wrong.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-edge-function-non-2xx-status-code.html#faq-what-does-edge-function-returned-a-non-2xx-status-

### Why does it work when I test the function in the Supabase dashboard?

The dashboard test sends its own valid body and authorization. Your app might be calling it with no signed-in user (401), an empty or wrong body (500 or 400), or from a different project or environment where a secret isn't set.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-edge-function-non-2xx-status-code.html#faq-why-does-it-work-when-i-test-the-function-in-the-s

### Should I just turn off JWT verification to make the 401 go away?

Only for functions that really are called without a user token, like Stripe webhooks or cron jobs, and then check the caller inside the function. For a function your signed-in users call, keep it on and make sure the user is logged in, otherwise anyone on the internet can call it and spend your OpenAI or email credits.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-edge-function-non-2xx-status-code.html#faq-should-i-just-turn-off-jwt-verification-to-make-th

### Is this the same as the CORS error?

No. 'Failed to send a request to the Edge Function' (FunctionsFetchError) means the browser never got a readable response, usually CORS or a crash before headers were sent. 'non-2xx status code' means a response did arrive, with an error status. A function that throws without CORS headers can cause either, so fix both.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-edge-function-non-2xx-status-code.html#faq-is-this-the-same-as-the-cors-error

### Why does my AI builder keep failing to fix it?

Because it only sees the generic message. Paste it the status code and the body from error.context, or the line from the function logs, and it can fix the real cause instead of rewriting code at random.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-edge-function-non-2xx-status-code.html#faq-why-does-my-ai-builder-keep-failing-to-fix-it

### How long until a free Supabase project pauses?

Supabase pauses Free plan projects that show too little database activity over a 7-day period. You get a warning email roughly a week before the pause and a confirmation email when it happens.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-project-paused-app-cant-connect.html#faq-how-long-until-a-free-supabase-project-pauses

### Will I lose my data when the project is paused?

No. A paused project keeps its data and settings, and you can resume it from the dashboard for up to 1 year after it was paused. After that you can still download the database backup and Storage files and restore them into a new project.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-project-paused-app-cant-connect.html#faq-will-i-lose-my-data-when-the-project-is-paused

### Is it 90 days or 1 year to restore?

In 2024 Supabase limited restores to 90 days. The current Supabase docs say a paused project can be restored for up to 1 year. If your project is older than that, use the backup download and restore route.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-project-paused-app-cant-connect.html#faq-is-it-90-days-or-1-year-to-restore

### Can a keep-alive ping stop the pause?

Supabase counts real API calls and dashboard visits as activity, and says a few requests a day is typically enough, but it is not guaranteed. If customers depend on the app, the reliable fix is a paid plan, because paid projects are never paused for inactivity.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-project-paused-app-cant-connect.html#faq-can-a-keep-alive-ping-stop-the-pause

### Why does my AI builder say the Supabase code is broken?

It only sees failed requests. The code is fine; the database is switched off. Resume the project first, then only fix what still fails afterwards.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-project-paused-app-cant-connect.html#faq-why-does-my-ai-builder-say-the-supabase-code-is-br

### What does PGRST116 mean in Supabase?

It means you called .single() (which asks for exactly one JSON object) and the query matched 0 rows or more than 1 row. PostgREST returns HTTP 406 with code PGRST116. The details field tells you which: 'contains 0 rows' or '2 rows' and so on.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-single-json-object-requested-no-rows-pgrst116.html#faq-what-does-pgrst116-mean-in-supabase

### Should I use .single() or .maybeSingle()?

Use .maybeSingle() when finding nothing is a normal outcome; it returns data: null with no error for 0 rows (but still errors on 2+ rows). Use .single() only when exactly one row must exist and a missing row is a real bug.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-single-json-object-requested-no-rows-pgrst116.html#faq-should-i-use-single-or-maybesingle

### The row is in the Table Editor, so why does .single() find 0 rows?

The Table Editor and SQL editor bypass Row Level Security. Your app runs as the anon or authenticated role, so RLS hides rows the current user cannot read. Check the SELECT policy, that the user is signed in when the query runs, and that user_id matches auth.uid().

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-single-json-object-requested-no-rows-pgrst116.html#faq-the-row-is-in-the-table-editor-so-why-does-single-

### Why did my message change to 'Cannot coerce the result to a single JSON object'?

Newer PostgREST versions reworded the message. The code (PGRST116) and the HTTP status (406) are the same, so match on the code, not the text.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-single-json-object-requested-no-rows-pgrst116.html#faq-why-did-my-message-change-to-cannot-coerce-the-res

### Why does insert().select().single() give a row-level security error instead?

Postgres requires rows returned by INSERT ... RETURNING to pass the SELECT policy and throws 42501 rather than dropping them silently. Add a SELECT policy for the owner or remove .select() if you do not need the inserted row back.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-single-json-object-requested-no-rows-pgrst116.html#faq-why-does-insert-select-single-give-a-row-level-sec

### Why do AI coding tools disable RLS?

Because it is the quickest way to make a permission error disappear. The agent is rewarded for 'the error is gone', and turning off Row Level Security, adding a using (true) policy or switching to the service_role key all achieve that, while making the table readable and often writable by anyone.

Answer on: https://unbreakmyapp.vercel.app/fixes/ai-fix-disabled-rls-or-swapped-service-role.html#faq-why-do-ai-coding-tools-disable-rls

### Is it ever OK to use the service_role or secret key?

Yes, on the server only: in Edge Functions, API routes, cron jobs and admin tools that check who the caller is first. It bypasses every RLS policy, so it must never be in a browser, mobile app bundle or source control.

Answer on: https://unbreakmyapp.vercel.app/fixes/ai-fix-disabled-rls-or-swapped-service-role.html#faq-is-it-ever-ok-to-use-the-service-role-or-secret-ke

### What is Security Advisor 0007 policy_exists_rls_disabled?

It means the table has RLS policies written, but RLS itself is turned off, so none of those policies are enforced. It is the classic sign that someone (or an AI agent) disabled RLS to get past an error. Re-enable RLS and the existing policies apply again.

Answer on: https://unbreakmyapp.vercel.app/fixes/ai-fix-disabled-rls-or-swapped-service-role.html#faq-what-is-security-advisor-0007-policy-exists-rls-di

### Will turning RLS back on break my app?

It can, if the app was relying on open access. Tables with RLS on and no policies block all access through the publishable key. Add owner-scoped policies for the operations you need before redeploying, then test as a signed-in user and a signed-out visitor.

Answer on: https://unbreakmyapp.vercel.app/fixes/ai-fix-disabled-rls-or-swapped-service-role.html#faq-will-turning-rls-back-on-break-my-app

### My sb_secret_ key returns 401 in the browser. Is that a bug?

No. Supabase blocks secret keys sent from a browser on purpose and returns HTTP 401. Use the publishable key in the browser and move the privileged call to a server route or Edge Function.

Answer on: https://unbreakmyapp.vercel.app/fixes/ai-fix-disabled-rls-or-swapped-service-role.html#faq-my-sb-secret-key-returns-401-in-the-browser-is-tha

### Does a Replit checkpoint rollback restore my database?

Only your development database, and only if you select Database under Additional rollback options before confirming. By default a rollback does not change your database, and it never touches the production database your published app uses.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-rollback-does-not-restore-database.html#faq-does-a-replit-checkpoint-rollback-restore-my-datab

### How do I restore my Replit production database?

Use point-in-time recovery in the Database tool: select Production, open Settings, expand Point-in-time recovery under Advanced, select Restore database... and enter a timestamp inside your recovery window. It is on by default with a 7-day window, up to 28 days on Pro, Teams and Enterprise. Scheduled daily backups are a second option if you turned them on.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-rollback-does-not-restore-database.html#faq-how-do-i-restore-my-replit-production-database

### I rolled back the code and republished. Why is the live data still wrong?

Because rolling back code does not change production data. Restore the production database to a point before the damage, then roll back to the matching checkpoint and publish again.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-rollback-does-not-restore-database.html#faq-i-rolled-back-the-code-and-republished-why-is-the-

### Can the Replit Agent delete my production data?

Replit says the Agent cannot modify the production database; it reads it through a read-only replica. Production data usually changes through your app, through manual edits with Enable Editing on, or when Publish applies development schema changes, such as dropping a column that was really renamed.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-rollback-does-not-restore-database.html#faq-can-the-replit-agent-delete-my-production-data

### My Replit app uses Supabase. Will a rollback restore it?

No. Replit's rollback and publish only manage Replit's own development and production databases. An external database such as Supabase has to be restored with that provider's backup tools.

Answer on: https://unbreakmyapp.vercel.app/fixes/replit-rollback-does-not-restore-database.html#faq-my-replit-app-uses-supabase-will-a-rollback-restor

### Why does my view ignore Row Level Security?

Because Postgres views run with the permissions of the view owner by default, not the person querying. In Supabase that owner is usually the postgres role, which bypasses RLS, so the view returns every row even though the table's policies are correct.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-view-bypasses-rls-security-invoker.html#faq-why-does-my-view-ignore-row-level-security

### What does security_invoker = true do?

It tells Postgres to check the underlying tables using the privileges and RLS policies of the user running the query, as if they had queried the tables directly. It was added in Postgres 15.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-view-bypasses-rls-security-invoker.html#faq-what-does-security-invoker-true-do

### After adding security_invoker my view returns no rows. Why?

The view is now subject to the base tables' RLS. If a table has RLS on but no SELECT policy for the signed-in role, no rows are visible. Add an owner-scoped SELECT policy to that table, and make sure the role has a GRANT on it.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-view-bypasses-rls-security-invoker.html#faq-after-adding-security-invoker-my-view-returns-no-r

### Can I protect a materialized view with RLS?

No. Supabase notes materialized views cannot respect RLS and cannot be secured with RLS directly, so revoke select from anon and authenticated and expose the data through a function or server route that checks the user.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-view-bypasses-rls-security-invoker.html#faq-can-i-protect-a-materialized-view-with-rls

### Is a view on auth.users ever safe?

Supabase recommends against exposing auth.users through a public view. Use a public.profiles table populated by a trigger, with its own RLS, so you only expose the columns you choose.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-view-bypasses-rls-security-invoker.html#faq-is-a-view-on-auth-users-ever-safe

### Why can a user change their own role if RLS is on?

Because RLS works on rows, not columns. An UPDATE policy using ((select auth.uid()) = id) lets the owner change any column in their own row, including role or plan, and the authenticated role has a table-level UPDATE privilege on all columns by default.

Answer on: https://unbreakmyapp.vercel.app/fixes/users-can-update-own-plan-or-role-column.html#faq-why-can-a-user-change-their-own-role-if-rls-is-on

### Can WITH CHECK stop a user changing their role?

Not by itself in a simple way. Postgres checks WITH CHECK against the new row only, so it can block role = 'admin' but cannot tell whether the value changed or who is allowed to change it. Use column-level grants, a separate roles table, or a BEFORE UPDATE trigger that compares OLD and NEW.

Answer on: https://unbreakmyapp.vercel.app/fixes/users-can-update-own-plan-or-role-column.html#faq-can-with-check-stop-a-user-changing-their-role

### How do I stop users updating one column in Supabase?

Revoke the table-level UPDATE privilege from authenticated and grant UPDATE only on the columns users may edit, for example revoke update on table public.profiles from authenticated; grant update (display_name, avatar_url) on table public.profiles to authenticated;. Revoking a single column while the table-level grant remains has no effect.

Answer on: https://unbreakmyapp.vercel.app/fixes/users-can-update-own-plan-or-role-column.html#faq-how-do-i-stop-users-updating-one-column-in-supabas

### Where should I store user roles in Supabase?

Supabase recommends RLS plus a dedicated table for user roles, such as public.user_roles, that users cannot write, optionally exposed as a JWT claim through a Custom Access Token Auth Hook. raw_app_meta_data is also safe because users cannot change it, unlike raw_user_meta_data.

Answer on: https://unbreakmyapp.vercel.app/fixes/users-can-update-own-plan-or-role-column.html#faq-where-should-i-store-user-roles-in-supabase

### Will my server and Stripe webhook still be able to set the plan?

Yes. Column grants and the trigger only restrict the anon and authenticated roles. Code using the service role key on the server, and the SQL editor, can still update protected columns.

Answer on: https://unbreakmyapp.vercel.app/fixes/users-can-update-own-plan-or-role-column.html#faq-will-my-server-and-stripe-webhook-still-be-able-to

### How many Lovable apps were leaking data?

Crissy Field analysed 159,041 Lovable projects found in Common Crawl (December 2025 to September 2026). 34,545 used Supabase and 24,664 sent Supabase records on page load without login. With extra read-only requests they found records containing email addresses in 10,560 tables across 7,403 of those sites. The researchers say this 30% figure is not a confirmed leak rate and the sample is not representative of all Lovable apps.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-app-leaking-data-without-login-audit-checklist.html#faq-how-many-lovable-apps-were-leaking-data

### Was Lovable or Supabase hacked?

No. The study describes apps whose own database access rules let anyone read data with the public API key. The fix is in each app's Row Level Security policies, grants, views and storage buckets.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-app-leaking-data-without-login-audit-checklist.html#faq-was-lovable-or-supabase-hacked

### How do I check if my Lovable app exposes data without login?

Open the published app logged out in a private window and read the rest/v1 responses in DevTools, then request each table with curl using only the publishable key on the apikey header. Any table that returns rows is readable by everyone. Then run the Supabase Security Advisor and Lovable's Deep scan.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-app-leaking-data-without-login-audit-checklist.html#faq-how-do-i-check-if-my-lovable-app-exposes-data-with

### Is the Lovable security scan enough?

It is a useful first check, but Lovable's docs say its scans help identify common issues and cannot guarantee complete security, and recommend a professional review for apps handling sensitive data. Always test with a logged-out visitor and with two separate user accounts.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-app-leaking-data-without-login-audit-checklist.html#faq-is-the-lovable-security-scan-enough

### Is it a problem that my Supabase key is visible in the browser?

Not by itself. Supabase says the publishable key is meant to be public and only reaches what Row Level Security allows. It becomes a problem when a table has RLS off or an open policy. The secret or service_role key must never be in the browser.

Answer on: https://unbreakmyapp.vercel.app/fixes/lovable-app-leaking-data-without-login-audit-checklist.html#faq-is-it-a-problem-that-my-supabase-key-is-visible-in

### Why does my Supabase file link say Bucket not found when the bucket exists?

Because the link is a public link (/storage/v1/object/public/...) and the bucket is private. Storage only looks among public buckets for that kind of link, so a private bucket is treated as not found. Make the bucket public if the files are meant to be public, or use createSignedUrl.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-storage-private-bucket-file-url-broken-signed-url.html#faq-why-does-my-supabase-file-link-say-bucket-not-foun

### Why do my Supabase signed URLs stop working?

A signed URL expires after the number of seconds you passed to createSignedUrl. After that Storage rejects it with an InvalidJWT error such as exp claim timestamp check failed. Store the file path in your table and create a fresh signed URL each time you show the file.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-storage-private-bucket-file-url-broken-signed-url.html#faq-why-do-my-supabase-signed-urls-stop-working

### Should I just make my Supabase Storage bucket public?

Only if anyone with the link may see every file in it, for example avatars or product photos. Public buckets skip access checks for reading. Keep invoices, IDs and private user uploads in a private bucket and use signed URLs.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-storage-private-bucket-file-url-broken-signed-url.html#faq-should-i-just-make-my-supabase-storage-bucket-publ

### Why does createSignedUrl return Object not found?

Either the path is wrong or your Storage policies do not let this user read the file. Creating a signed URL checks the SELECT policies on storage.objects. Check the exact path, then add a SELECT policy for the right users.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-storage-private-bucket-file-url-broken-signed-url.html#faq-why-does-createsignedurl-return-object-not-found

### Can I cancel a signed URL I already shared?

Not one by one. Supabase says you cannot revoke individual signed URLs; delete, move or rename the file to stop that link, or rotate your project's URL signing key to stop all of them. Use short expiry times for private files.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-storage-private-bucket-file-url-broken-signed-url.html#faq-can-i-cancel-a-signed-url-i-already-shared

### What is an IDOR in a web app?

An insecure direct object reference: the app uses an id from the URL or request to load a record but never checks that the logged-in user may access it. Change /orders/123 to /orders/124 and you get someone else's order. OWASP calls the API version Broken Object Level Authorization (API1:2023).

Answer on: https://unbreakmyapp.vercel.app/fixes/change-id-in-url-see-other-users-data-idor.html#faq-what-is-an-idor-in-a-web-app

### Do random UUIDs stop IDOR?

No. They make ids harder to guess, but ids leak in shared links, emails, logs and screenshots. OWASP treats random ids only as defence in depth; the server or database must still check ownership on every request.

Answer on: https://unbreakmyapp.vercel.app/fixes/change-id-in-url-see-other-users-data-idor.html#faq-do-random-uuids-stop-idor

### Is .eq('user_id', user.id) in my Supabase query enough?

Not in browser code. Anyone can call the Supabase API with your public key and leave the filter out. Use an RLS policy such as using ((select auth.uid()) = user_id), and keep the filter only for speed.

Answer on: https://unbreakmyapp.vercel.app/fixes/change-id-in-url-see-other-users-data-idor.html#faq-is-eq-user-id-user-id-in-my-supabase-query-enough

### Why does my API route return any user's record even with RLS on?

It probably uses the service_role or sb_secret_ key, which bypasses RLS when no user token is sent. Use a client with the user's session so RLS applies, or add an owner filter based on the user id from getClaims().

Answer on: https://unbreakmyapp.vercel.app/fixes/change-id-in-url-see-other-users-data-idor.html#faq-why-does-my-api-route-return-any-user-s-record-eve

### Should I return 403 or 404 when a user requests someone else's record?

OWASP suggests that when existence is sensitive you scope the lookup to the current user and give the same answer, such as 404, for 'not found' and 'not allowed', so attackers cannot tell which ids exist.

Answer on: https://unbreakmyapp.vercel.app/fixes/change-id-in-url-see-other-users-data-idor.html#faq-should-i-return-403-or-404-when-a-user-requests-so

### How do I test my app for IDOR?

Create two accounts, give each its own data, log in as one and request the other's ids in every URL, API call, update, delete and export. Also try logged out. Then turn this into an automated test that runs before every deploy.

Answer on: https://unbreakmyapp.vercel.app/fixes/change-id-in-url-see-other-users-data-idor.html#faq-how-do-i-test-my-app-for-idor

### Why does Supabase only return 1,000 rows?

Supabase's Data API caps every request at a maximum number of rows, 1,000 by default, to limit the payload of accidental or malicious requests. Queries that match more rows return only the first 1,000 and no error. Use range() to page through the rest.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-only-1000-rows-returned-max-rows.html#faq-why-does-supabase-only-return-1-000-rows

### Why doesn't .limit(5000) return 5,000 rows from Supabase?

Max rows is a hard limit on what PostgREST will return for a table, view or function. limit() can ask for fewer rows than the cap, but not more. Page with range() instead.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-only-1000-rows-returned-max-rows.html#faq-why-doesn-t-limit-5000-return-5-000-rows-from-supa

### How do I get the total row count in Supabase?

Use the count option: select('*', { count: 'exact', head: true }) returns only the count. With range() it returns the total number of matching rows, not the size of the page. Use 'planned' or 'estimated' on very large tables where an exact count is slow.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-only-1000-rows-returned-max-rows.html#faq-how-do-i-get-the-total-row-count-in-supabase

### Should I just increase Max rows in Supabase?

Usually not. Supabase recommends keeping it low. A higher cap makes every unpaged query heavier and lets anyone with your public key download more rows per request. Paginate lists and do totals in the database instead.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-only-1000-rows-returned-max-rows.html#faq-should-i-just-increase-max-rows-in-supabase

### Does the 1,000 row limit apply to rpc functions?

Yes. The setting is the maximum number of rows returned from a view, table or function. Page inside the function or chain range() and order() on the rpc() call, or return an aggregated result instead of raw rows.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-only-1000-rows-returned-max-rows.html#faq-does-the-1-000-row-limit-apply-to-rpc-functions

### Why do my paginated Supabase results repeat or skip rows?

range() without a stable order can return rows in a different order on each request. Add .order('id') (or created_at plus id) so every page is cut from the same sorted list.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-only-1000-rows-returned-max-rows.html#faq-why-do-my-paginated-supabase-results-repeat-or-ski


## Env vars & leaked keys

### Is the anon key safe to expose?

Yes, it is designed to be public, as long as RLS policies protect your tables.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-service-role-key-exposed.html#faq-is-the-anon-key-safe-to-expose

### I already deployed it. What now?

Rotate it first, then fix the code. Assume it was copied.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-service-role-key-exposed.html#faq-i-already-deployed-it-what-now

### Does a .env file hide it?

Only for server code. Anything bundled for the browser is public.

Answer on: https://unbreakmyapp.vercel.app/fixes/api-key-leaked-in-frontend.html#faq-does-a-env-file-hide-it

### Is the Stripe publishable key okay to expose?

Yes. pk_ keys are public; sk_ and rk_ keys are secret.

Answer on: https://unbreakmyapp.vercel.app/fixes/api-key-leaked-in-frontend.html#faq-is-the-stripe-publishable-key-okay-to-expose

### Why does it work locally?

Your local dev server reads .env; the deployed build doesn't have that file.

Answer on: https://unbreakmyapp.vercel.app/fixes/env-var-undefined-in-production.html#faq-why-does-it-work-locally

### Do I need to redeploy?

Yes. Env vars are injected at build/deploy time.

Answer on: https://unbreakmyapp.vercel.app/fixes/env-var-undefined-in-production.html#faq-do-i-need-to-redeploy

### Does 429 always mean rate limiting?

'Exceeded your current quota' is about billing or limits; 'rate limit reached' is about speed.

Answer on: https://unbreakmyapp.vercel.app/fixes/openai-429-rate-limit-runaway-bill.html#faq-does-429-always-mean-rate-limiting

### Should I set a budget?

Yes, set a hard limit in billing settings.

Answer on: https://unbreakmyapp.vercel.app/fixes/openai-429-rate-limit-runaway-bill.html#faq-should-i-set-a-budget

### Is deleting the file enough?

No, it stays in git history; rotate the keys.

Answer on: https://unbreakmyapp.vercel.app/fixes/git-env-file-committed.html#faq-is-deleting-the-file-enough

### Private repo?

Still rotate. Collaborators, integrations and forks can see it.

Answer on: https://unbreakmyapp.vercel.app/fixes/git-env-file-committed.html#faq-private-repo

### Should I pay the person who reported it?

You don't have to pay for an unsolicited report, and you shouldn't pay before verifying it. Many low-effort 'beg bounty' emails describe automated scanner output. If a report was genuinely useful, a thank-you or a small reward is your choice.

Answer on: https://unbreakmyapp.vercel.app/fixes/vibe-coded-app-security-hole-reported-first-steps.html#faq-should-i-pay-the-person-who-reported-it

### Is it really a hole if they only used my public anon key?

The Supabase anon key is meant to be public, so seeing it isn't the problem. The problem is if that key can read or change data it shouldn't, which means RLS is missing or too permissive on some table.

Answer on: https://unbreakmyapp.vercel.app/fixes/vibe-coded-app-security-hole-reported-first-steps.html#faq-is-it-really-a-hole-if-they-only-used-my-public-an

### Do I need to tell my users?

It depends on whether personal data was actually accessed and on the law where you and your users are. Under UK and EU GDPR, reportable breaches generally go to the regulator within 72 hours, and to users if there's a high risk to them.

Answer on: https://unbreakmyapp.vercel.app/fixes/vibe-coded-app-security-hole-reported-first-steps.html#faq-do-i-need-to-tell-my-users

### How do I stop this happening again?

Add RLS to every table in the same migration that creates it, check ownership on the server for every id-based route, keep secrets server-only, and run a security review prompt before each launch.

Answer on: https://unbreakmyapp.vercel.app/fixes/vibe-coded-app-security-hole-reported-first-steps.html#faq-how-do-i-stop-this-happening-again

### My keys are in environment variables, so how can they leak?

Environment variables keep keys out of your code, but your server still uses them in requests. If the error from that request is sent back whole, the key or Authorization header can travel with it.

Answer on: https://unbreakmyapp.vercel.app/fixes/backend-error-leaks-api-key-to-browser.html#faq-my-keys-are-in-environment-variables-so-how-can-th

### Is showing err.message safe?

Your own messages are. Messages from SDKs, database drivers and HTTP clients can include URLs, queries, request details and sometimes credentials, so log them on the server and show a generic message instead.

Answer on: https://unbreakmyapp.vercel.app/fixes/backend-error-leaks-api-key-to-browser.html#faq-is-showing-err-message-safe

### Do I really need to rotate the key if it only showed in an error?

Yes. Anyone who saw the response, any browser extension, and any log or screenshot may have it. Rotating is quick and is the only way to be sure the old key is useless.

Answer on: https://unbreakmyapp.vercel.app/fixes/backend-error-leaks-api-key-to-browser.html#faq-do-i-really-need-to-rotate-the-key-if-it-only-show

### How do I still debug production errors?

Log the full error on the server with an ID, return that ID to the user, and look it up in your hosting logs or an error tracker such as Sentry when someone reports a problem.

Answer on: https://unbreakmyapp.vercel.app/fixes/backend-error-leaks-api-key-to-browser.html#faq-how-do-i-still-debug-production-errors

### Is it enough to delete the key from my code or repo?

No. The key still works until you revoke or roll it at the provider, and old copies live on in git history, logs and anywhere it was pasted.

Answer on: https://unbreakmyapp.vercel.app/fixes/rotate-api-keys-after-leak-or-breach.html#faq-is-it-enough-to-delete-the-key-from-my-code-or-rep

### Will rotating keys break my app?

Only if you revoke the old key before the new one is live everywhere. Create the new key, update every place it's stored, redeploy, test, then revoke. If the key is being abused right now, revoke first and accept a short outage.

Answer on: https://unbreakmyapp.vercel.app/fixes/rotate-api-keys-after-leak-or-breach.html#faq-will-rotating-keys-break-my-app

### Do I need to rotate the Supabase anon or publishable key?

Those keys are designed to be public, so a leak on its own isn't an emergency as long as RLS protects your tables. Rotate secret and service_role keys, and fix RLS if anyone could read data with the public key.

Answer on: https://unbreakmyapp.vercel.app/fixes/rotate-api-keys-after-leak-or-breach.html#faq-do-i-need-to-rotate-the-supabase-anon-or-publishab

### A platform I use was breached but my key isn't in the news. Should I still rotate?

Yes. If a service stored your keys or had access to your project, rotating takes minutes and removes the doubt. Do it in the safe order and check your usage for anything you didn't do.

Answer on: https://unbreakmyapp.vercel.app/fixes/rotate-api-keys-after-leak-or-breach.html#faq-a-platform-i-use-was-breached-but-my-key-isn-t-in-


## Performance

### Do I need a bigger plan?

Usually not; pooling fixes it.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-too-many-connections.html#faq-do-i-need-a-bigger-plan

### Why separate DIRECT_URL?

Migrations need a direct session connection.

Answer on: https://unbreakmyapp.vercel.app/fixes/supabase-too-many-connections.html#faq-why-separate-direct-url

### How do I spot it?

Open DevTools → Network and count requests on page load.

Answer on: https://unbreakmyapp.vercel.app/fixes/slow-page-n-plus-one-queries.html#faq-how-do-i-spot-it

### Do indexes help with RLS?

Yes, index columns used in policies, like user_id.

Answer on: https://unbreakmyapp.vercel.app/fixes/slow-page-n-plus-one-queries.html#faq-do-indexes-help-with-rls

### Can it cost me money?

Yes, looping fetches can burn API credits and database quota.

Answer on: https://unbreakmyapp.vercel.app/fixes/useeffect-infinite-loop.html#faq-can-it-cost-me-money

### Should I disable the lint rule?

No. The exhaustive-deps warning usually points at the bug.

Answer on: https://unbreakmyapp.vercel.app/fixes/useeffect-infinite-loop.html#faq-should-i-disable-the-lint-rule


---
Unbreak My App: free fixes for broken vibe-coded apps. https://unbreakmyapp.vercel.app/
