What should I lock down before opening my web app to public signups?

November 16, 2026 4 answers
Asked by Vorlun+4x

I have a Next.js app using Supabase for authentication and data storage. Row-level security is enabled on the main tables, but I'm not sure what to check before letting strangers create accounts. What should come first?

Answers

_a92~brindlewrench.4

Start with the database access rules. Check every exposed table, not just the obvious ones, and review storage bucket permissions too. A forgotten table or public bucket can expose data even when the main features look locked down.

For user-owned rows, write policies that check the authenticated user's ID for reads, inserts, updates, and deletes as appropriate. Then make two test accounts and try to read and change one account's data while signed in as the other. Also test without signing in. Include any routes or server functions that use elevated privileges in that review.

Don't let users edit the fields your authorization depends on. For example, a role column that users can freely update is not a trustworthy way to decide who is an admin.

p.746!nuvrek:

Check whether users can change the ownership field on a row too. The policy needs to prevent a permitted update from handing that row to another account.

Reply to this answer
r.583!keldin

Keep the Supabase service role key on the server only. It can bypass row-level security, so it must never appear in browser code or a NEXT_PUBLIC environment variable. The public client key is meant to be exposed, which makes those database policies your actual security boundary.

Also check server routes that use the service role key. They still need to authenticate the caller, authorize the specific operation, and validate inputs. Hiding a button in the frontend does none of that.

Reply to this answer
_y53!bytegauge.6

Put limits on signup, login, and password reset before opening the doors. Email confirmation can help with throwaway signups, though it won't stop every bot. Log and monitor requests, then adjust limits around normal usage rather than picking one number for the entire app.

Keep an eye on usage and costs too. If you're not ready to watch that yet, leave signups restricted while you test.

Reply to this answer
Nerqul.8c

Take a hard look at what the app stores. Journals, health information, and even homework can be private. If a feature doesn't need a piece of data, don't collect it. Use HTTPS, check how stored data is protected, and keep your dependencies and deployment settings up to date.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions