Lovable admin page accessible without login: hiding it isn't locking it

What happened in our own app

We built an app with AI. The users' records were locked down. The internal lead CRM wasn't in the menu, so we assumed it was private. Signed out, we typed /crm: the page loaded, and so did the API behind it. Names, emails and phone numbers of every lead.

Nobody asked the AI to protect the CRM, so it didn't. AI builders protect what you ask for, not what you forget to ask for.

Two layers, and you need both

Many apps have the first layer and not the second. The page redirects, but the request it makes still answers anyone who sends it.

How to check it yourself

  1. Write down every private address in your app: /admin, /dashboard, /crm, /settings, /reports, /users, and any page only some users should see.
  2. Open a private window (signed out) and type each one. You should land on the login screen, with no flash of real data.
  3. Sign in as a normal user (not admin) and try the admin addresses again.
  4. With the developer tools open (Network tab), load the admin page as admin and note the requests it makes (to /api/... or to supabase.co). Then repeat those requests signed out. They should return 401/403 or nothing, never the list.

Prompt to fix it

Fix prompt

Protect every private area of the app on the server, not only in the UI. For each admin or internal page (/admin, /crm, /dashboard, /reports and any page only some users should see): redirect to the login page when there's no session or the user doesn't have the required role. Then protect the data it uses: every API route behind these pages must check the session and role on the server and return 401 or 403 otherwise, and every database table they read must have Row Level Security policies that only allow admins (for example a check against an is_admin column on the user's profile). Don't rely on hiding links. List every page, route and policy you changed.

Then repeat the signed-out test, including the data requests.

Want us to run this test for you?

The US$9 crash test without code signs in as two test users on your live app and checks this for you: data between users, private pages and the API behind them, free vs. paid plans, and what your public Supabase key opens. You get the evidence and a fix prompt for each issue.

Related guides

Updated 2026-11-24