Harrison Crettol
Live demo
firebase auth database

Sign In, Save,
Come Back

Google sign-in on one side, a real cloud database on the other. Log in, rack up a score, save it — then open this page on your phone and find the same number waiting. That's all a login really is.

Try it

0
Current score
Welcome!

What's happening

Google proves who you are

Clicking sign in hands you to Google, which checks your password and sends back a signed token. My site never sees the password — only your name, photo, and a permanent unique ID called a uid.

Your uid is the filing system

Your score is stored in a Firestore document at users/{your uid}. Since the uid comes from Google's signed token and not from anything the browser can type, one person can't read or write another person's document.

Clicking is local, saving is not

The counter goes up instantly because nothing leaves your browser yet. Only Save to DB sends a write to the database. That's why Reset doesn't lose your saved score — it only clears the local count.

The rules are on the server

A file called firestore.rules lives with the database, not in this page. It says a signed-in user may only touch their own document, and only with a valid score. Anyone editing this page in their browser hits that wall.

The actual test

Save a score here, then open this page on your phone and sign in with the same Google account. The number is already there. Nothing was stored on either device.