# 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.

Web page: https://buildladder.com/answers/test-with-two-accounts

## What to do

- 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.

## What you do

- 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.

## What your AI tool does

- 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.

## Prompt to copy

```text
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.
```

## Sources

Updated 2026-11-10.

- [Supabase: Row Level Security](https://supabase.com/docs/guides/database/postgres/row-level-security)
- [Firebase: Avoid insecure rules](https://firebase.google.com/docs/rules/insecure-rules)
- [Firebase: Get started with Security Rules](https://firebase.google.com/docs/firestore/security/get-started)
- [Clerk: Test emails and phones](https://clerk.com/docs/guides/development/testing/test-emails-and-phones)
- [Supabase: Send emails with custom SMTP](https://supabase.com/docs/guides/auth/auth-smtp)
