# Supabase Troubleshooting

## Login does not work

Check:

- `SUPABASE_URL` and `SUPABASE_ANON_KEY` in `js/config.js`
- Your site is using HTTPS
- Supabase Auth provider is enabled
- Redirect URLs include your domain
- Browser console for Supabase errors

## The game still says local/guest mode

Usually this means:

- Config values are still blank
- Old `js/config.js` is cached
- Service worker is serving an old file

Fix:

1. Open `beta-start.html`.
2. Press Clear PWA Cache.
3. Hard refresh.
4. Re-open `dashboard.html`.

## Parcels do not save online

Check:

- You are signed in, not guest mode
- SQL schema was run fully
- `atlas_parcels` table exists
- RPC/function permissions are correct
- Browser console does not show RLS or permission errors

## Second player can buy the same parcel

This means global ownership is not being enforced.

Check:

- The buy function/RPC exists
- Parcel ID is being sent correctly
- Database has unique parcel ID constraints
- RLS policies allow the RPC but do not allow unsafe direct writes

## Leaderboard is blank

Check:

- `atlas_leaderboard` table exists
- Signed-in player has published stats
- RLS allows public read of leaderboard rows
- Browser console for permission errors

## Payout/cashout does not unlock

That is expected until payout provider, legal terms, age/region rules, fraud checks, and tax/KYC flow are ready.

Do not switch real payouts live during prototype testing.
