Sign-in and the phone app
The box has its own sign-in page. Sign in once on a device and it remembers you for a year. Added to a phone's home screen, the whole thing becomes one app called The Office, which can send notifications.
Where you see it
The sign-in page. Its title is "The Office, sign in". It has a username box, a password box, and one button. It is light only, with no dark mode, because you see it about once per device.
The sign-in page. It stays signed in on the device.
The username box is there only so a password manager will save the login. The box ignores what is typed in it. The password is what counts.
The home-screen app. On a phone, add the page to the home screen. It shows up as one app named The Office, with its own icon. It opens straight to the Office.
Notifications. The app can send real phone notifications. Tap one and it opens that conversation. If the Office is already open in a tab, it jumps there instead of opening a second one, and opens that chat in the open Office. If another chat is showing, it switches to the one you tapped.
Turning notifications on or off. Tap the bell at the top of the Office. It opens Settings on this device with one switch: Tell me when an answer is ready. It turns notifications on or off for the phone or computer you are holding, and only that one. Reload the page and the switch still shows the truth. When it cannot work, it says why in plain words and the switch stays grey:
- On an iPhone, add the Office to your Home Screen first (Share, then Add to Home Screen), open it from there, and turn it on.
- If the browser is blocking alerts, allow them in the browser's settings for the site, then come back.
- If the box has no notification keys yet, it says alerts are not set up.
What happens, step by step
- YouYou open the address on a new phoneThe phone has no sign-in cookie yet.
- CodeThe box shows the sign-in pageNothing else is visible.
- YouYou type the passwordA password manager can fill it in after the first time.
- GateThe box checks itToo many wrong tries and it stops accepting them for a while.
- StoreThe phone gets a signed cookieGood for a year.
- YouAdd it to the home screenFrom then on, one tap opens the Office.
- The owner opens the box's address on a new phone. The phone has no sign-in cookie (a small saved pass) yet.
- The box shows the sign-in page.
- The owner types the password. The phone's password manager fills it in after the first time.
- The box checks it. Too many wrong tries in a row, and it stops accepting tries for a while.
- On success, the box gives the phone a signed cookie good for a year. It moves the phone to the page it asked for as a normal page load, so the password manager offers to save.
- The owner adds it to the home screen. From now on, one tap opens The Office.
What powers it
| Part | What it does |
|---|---|
sdk_login.html | The sign-in page. |
login() in sdk_server.py | Checks the password against a stored hash (a scrambled copy that cannot be turned back into the password). Limits wrong tries. |
guarded() in sdk_server.py | Runs on every page and request. Checks the cookie and what that user is allowed to see. |
cookie.key | A secret key on the box used to sign cookies. It is separate from the page's address, so a leaked address alone cannot make a valid cookie. |
app.webmanifest | Names the home-screen app The Office and sets its icon and start page. |
sw.js | The service worker (a small helper the phone keeps running). It turns a push message into a real notification. |
push_switch.js | The on/off switch's logic: signs this device up for notifications, or signs it off, and remembers an off choice. |
Why it works this way
Why a page and not the browser's pop-up. Sign-in used to be the browser's built-in pop-up box. Password managers could not save it. On an iPhone home-screen app, it asked again every single time the app opened. The owner's words: "it doesn't prompt me to save it... really just doesn't work." So it was replaced with a real page and a real form, built so password managers would treat it like any other login.
Two things, not one. Getting in takes both the page's private address (something you have) and the password (something you know).
One app, not two. Every screen points to the same app manifest (the file that tells a phone what the app is called). So only one app ever lands on the home screen, and it is always The Office.
If the box is missing the pieces for push, notifications simply stay off. Nothing else breaks.
Connected to
- The Office: where the app opens.
- Secrets and logins: how keys and passwords are kept on the box.
- Server lockdown: the other locks around the box.
- Doors: the different ways into the system.