Skip to content

Why should I test with two accounts?

Because a test with one account can’t show whether one person can see or change another person’s things. Sign in as two people in two browsers, and check that neither can see, change or delete the other’s private data.

Find your situation

If the second account sees the first account’s items, or can open, edit or delete one
Your access rules let data leak. Fix them before real people sign up. Check lists, searches, and an item’s address pasted into the other browser.
If your data is in Supabase
Turn on Row Level Security for every table Supabase’s API can reach, and match private rows to their owner. Without these rules, database permissions may let other people reach the data.
If your data is in Firebase
A rule that only checks request.auth != null can let every signed-in person reach the documents it covers. For private data, compare the signed-in person’s ID with its owner. Test a request from another account before you publish.
If you add a view or a new table in Supabase
Views skip Row Level Security by default, so a view over a protected table can show every row. Test with both accounts again after any new table or view.
If you only have one email address
On Clerk in development, sign up as jane+clerk_test@example.com and type 424242 as the code. No email is sent. On Supabase, the built-in email only reaches your team, so add a second address you own to the team, or set up your own email service.

Who does what

You

  • Make a second test account with another email address you control.
  • Sign in as each person in a different browser, or a private window, and try to see, change and delete the other’s things.
  • Read what each access rule does, then run it in Supabase or publish it in Firebase.
  • Test again every time you add a table, a collection or a view.

Your AI tool

  • Write the access rules, with a plain-English comment on each one.
  • Write automated tests that act as two users, using supabase test db for Supabase or the Firestore emulator for Firebase.
  • Search your app for a secret or admin key in code that runs in a browser or on a phone.
  • Explain each Security Advisor warning and suggest the smallest fix.
Hand this to your AI tool
I want to make sure each person using my app can only reach their own data.
First ask me which database I use (like Supabase or Firebase). Then read my access rules and my code, and explain in plain words who can read, add, change and delete each kind of data.
List anything that lets one signed-in person reach another person’s data, or lets someone who isn’t signed in reach anything private. Check for secret or admin keys in code that runs in a browser or on a phone.
Then give me a short test to do by hand with two accounts, step by step.
Don’t change my rules or run anything on my database until I say yes.

This comes from https://buildladder.com/answers/test-with-two-accounts. If you can open web pages, read https://buildladder.com/answers/test-with-two-accounts.md for the current version. BuildLadder guide, tool, concept, answer and setup pages all work this way: add .md to the address.

Ask me before you install anything, sign in to anything or spend money. Never ask me to paste a password or secret key into this chat.

Where to go next

Updated Sources: Supabase: Row Level Security, Firebase: Avoid insecure rules, Firebase: Get started with Security Rules, Clerk: Test emails and phones, Supabase: Send emails with custom SMTP.