Debug webhooks that fail only in the native app
'Works in preview' wasn't 'works on a phone' · Reddit r/vibecoding · u/Cool_Artist7009 · Jul 2026
What happened
Wrapping a Lovable app with Capacitor led to failing RevenueCat webhooks. The cause was Supabase's own auth check running before the code, which none of the AI tools spotted.
The honest numbers
- Says 15+ hours to get it working
- Says webhooks were failing at a 100% error rate
As stated by the source. Not independently verified.
The lesson
When a webhook fails, check the platform layer (auth on the function, secrets per environment) before rewriting the code.
Fix prompt for your own AI tool
Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.
I'm a beginner with a Lovable app that takes payments with Stripe (or a similar provider). Please audit the payment flow. 1) Find the webhook endpoint and check that it verifies the provider's signature using the raw request body, and isn't blocked by my own auth (e.g. Supabase verify_jwt on the function). 2) Check that it handles failed payments, refunds, cancellations and the same event arriving twice (idempotency). 3) Make sure only the server/webhook can change a user's plan or credits, never the browser. 4) List problems with file names and fixes, then give me a test checklist using test-mode events and one small real payment. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.
Why this keeps happening: payments & webhooks
Checkout pages are easy to generate, but the important logic runs in webhooks: confirming payment, upgrading the account and handling failures. If webhooks fail silently, customers pay and get nothing, or get access without paying.
A quick checklist before you ship
- Verify webhook signatures on the server.
- Handle failed, refunded and duplicate events, not only successful ones.
- Make upgrades depend on the confirmed payment event, not the redirect page.
- Run one real payment end to end before launch and check the account changes.
More on this: every payments & webhooks story and our related guide.
Tools involved
Lovable stories, Supabase stories, RevenueCat stories, Capacitor stories
Related stories
- Fix login when wrapping a web app for iOS
Going native broke authentication three ways - Fix Stripe webhooks rejected by Supabase auth
First customer paid, but the app never upgraded him - Open your Lovable app logged out, query each Supabase table with the public anon key, and turn on Row Level Security with owner-only policies for anything that comes back
Crissy Field: 7,403 Lovable sites returned tables with email addresses to anyone, no login needed
Source: original post on Reddit r/vibecoding ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.