Lovable: Missing auth on endpoints
Your app’s server functions and API routes should check who is calling. AI tools often build the page login but forget to check the login on the route behind it.
Free scan: check my app Just your web address. Results in seconds. No signup, no card.
Why it matters for your Lovable app
Lovable apps usually use Supabase for the database and login. Lovable has a built-in security scan, but it can’t sign in as two real users and compare what each one sees.
Someone skips your screens and calls the route directly to read or change data.
How to check in five minutes
- List every API route or edge function.
- Call each one while signed out, for example from a private browser window. It should refuse.
- Make sure each route reads the user from the session, not from a user ID sent by the browser.
What PeekLok’s scan checks
PeekLok’s automatic scan does not test whether your routes or functions check the login. Use the check above for this one.
Fix prompt to paste into the Lovable chat
For every API route and server function, require a valid signed-in session and return 401 if there isn’t one. Get the user ID from the verified session, never from the request body or URL. Show me a list of every route and the check you added. (This is a Lovable app using Supabase. Keep secrets in Supabase Edge Function secrets.)
After the AI makes changes, test again with two accounts. AI fixes can look right and still miss a table or route.
Sources
Related
- Can anyone call my Supabase Edge Function? A check for Lovable and Bolt apps
- Lovable: Supabase RLS turned off
- Lovable: Exposed anon or service role key
- Lovable: Open database tables
- Lovable: API keys in front-end code
- Lovable: Missing security headers
- Lovable: One customer can see another’s data
Same issue in other builders:
All Lovable security guides · Missing auth on endpoints explained
Get a free scan
PeekLok checks your live app for secret keys in the page code, a Supabase service or anon key showing, Supabase tables anyone can read with the public key, and five browser security headers. If your app uses Supabase login, you can add two test logins and it checks whether one user can see the other’s data. Only scan apps you own. First scan free. Weekly re-checks will be $12 US a month once payments open.
