Skip to content
VibeSafeDaily

Auth

Hiding the sign-up page doesn't close sign-up on a Supabase app

Cataloged October 28, 2026 · Supabase · Lovable · Bolt · Cursor

Symptom

You built an internal tool, a client portal, or a beta that only your people should use. Your AI tool removed the sign-up link and kept only a login page, and your policies say to authenticated. A stranger can still create an account with the publishable key your app already ships, sign in, and read everything those policies allow. If anonymous sign-ins are on, they do not even need an email address.

Root cause

Sign-up is a setting on your Supabase project, not a page in your app. Supabase's general configuration guide lists Allow new users to sign up as an Auth option, and only when it is disabled can only existing users sign in. Removing the form from the UI changes nothing on the server: supabase.auth.signUp({ email, password }) works from any browser console or script that has your project URL and publishable key, and both are in your frontend bundle by design. Email confirmation does not help much here, because a stranger can confirm with a real inbox. Once signed in, the user's requests run as the authenticated Postgres role, the same role your real users get. A policy written as to authenticated using (true), or one that only checks that someone is logged in, now covers the stranger too. Anonymous sign-ins widen this. Supabase's anonymous sign-ins guide says signInAnonymously() creates a user that uses the authenticated role, the same as a permanent user, and warns you to review your RLS policies before enabling it; policies must check the is_anonymous claim in the JWT to tell the two apart. AI tools often write the login page and the policies in separate steps, so nothing ever connects "only my team" to a check the database can enforce.

Before and after

The before policy lets any signed-in account read every project, including an account a stranger made with your public key. The after policy only lets listed members read.

Before

create policy "signed-in users can read projects" on public.projects
  for select to authenticated
  using (true);

After

create policy "members can read projects" on public.projects
  for select to authenticated
  using (exists (
    select 1 from public.members m
    where m.user_id = (select auth.uid())
  ));

Fix prompt

In this project only. Do not test against anyone else's app.

1. Tell me who is supposed to have an account in this app: anyone, only invited people, or only people from one email domain. Ask me if you can't tell from the code.

2. If it is not "anyone": tell me to turn off "Allow new users to sign up" in my own Supabase project's Auth settings, and to check whether anonymous sign-ins are enabled. Do not try to change project settings yourself.

3. Replace self sign-up with invites. Add a server-only route or edge function that calls supabase.auth.admin.inviteUserByEmail(email) using the secret or service role key from server environment variables, and only lets an existing admin call it. Never put that key in browser code.

4. Find every RLS policy that grants access just for being signed in: to authenticated using (true), with check (true), or checks like auth.uid() is not null. For each one, list the table and tell me what it lets any signed-in account do.

5. Rewrite those policies to check membership instead. Create a table such as public.members (user_id uuid primary key references auth.users on delete cascade, role text not null), enable RLS on it, give users no insert or update on it, and scope the other policies with exists (select 1 from public.members m where m.user_id = (select auth.uid())). Add the needed grants for each new table in the same migration.

6. If anonymous sign-ins are on and the app uses them, add a restrictive policy on every table anonymous users must not write to: as restrictive for insert to authenticated with check ((select (auth.jwt()->>'is_anonymous')::boolean) is false). Do the same for update and delete where it applies.

7. Tell me how to verify on my own app: create a test account that is not in members, sign in as it, and confirm it gets zero rows and cannot write anything.

Do not print keys, tokens, or user data. Do not edit unrelated files.

Paste this into the coding tool that has your own project open.

2-minute self-check

These steps are for an app you own. Do not run them against someone else's project.

  1. In your own Supabase dashboard, open the Auth settings and check whether Allow new users to sign up is on. If your app is meant for invited people only and it is on, anyone with your public key can create an account.
  2. In your own project's SQL editor, run select count(*) filter (where is_anonymous) as anonymous_users, count(*) as all_users, max(created_at) as newest from auth.users; Compare the count to the people you expect. Unknown or anonymous accounts on a private app mean sign-up is reachable.
  3. Still in your own project, run select tablename, policyname, cmd, roles, qual, with_check from pg_policies where schemaname = 'public' and (qual = 'true' or with_check = 'true' or qual ilike '%auth.uid() is not null%'); Every row is a table any signed-in account can use, including one a stranger just created.
  4. If you use anonymous sign-ins, search your own policies for is_anonymous. Supabase's guide says anonymous users get the authenticated role, so a table with no is_anonymous check treats them like full members.

Common questions

My app has no sign-up page. How can someone make an account?

The sign-up page is only a form that calls Supabase Auth. The call itself, supabase.auth.signUp, works from any script that has your project URL and publishable key, and both ship in your frontend on purpose. Whether it succeeds is decided by your project's Allow new users to sign up setting, not by your UI.

If I turn off sign-ups, how do I add the people who should have access?

Invite them. Supabase's admin API has inviteUserByEmail, which sends an invite link. Call it only from server code that holds the secret key, and only for an admin who is already signed in.

Are anonymous users treated differently by my policies?

Not unless you make them. Supabase's anonymous sign-ins guide says anonymous users use the authenticated role like permanent users, and that policies must check the is_anonymous claim to tell them apart. It also recommends making those checks restrictive policies so another permissive policy cannot cancel them out.

Sources

Same symptom

Same platform