When should a one-time QR code stop working?
Adding a phone passkey to Note raised a small design question. If you scan the code and dismiss the prompt, should you have to go back to your laptop?
Suppose you’re signed in to Note, the editorial desk we use to publish these posts. You want to add a passkey on your phone. You open Account on your laptop, scan the QR code, and tap Create passkey. Then you dismiss the phone’s prompt. Maybe you picked the wrong password manager. Your laptop is in the other room. Can you just tap the button again?
In Note, you can. Getting that detail right meant deciding exactly what counts as using a one-time code.
What the phone gets
The QR code opens a private enrollment link. Anyone holding that link has a short window to add a passkey to your account, so Note asks for recent passkey verification before it shows the code. The link expires after five minutes. You can cancel it from the laptop, and signing out there invalidates it too.
Scanning gets the phone to the right page. Tapping Create passkey starts a conversation between the browser and the device that will hold the credential. Either step can happen before you’ve decided where to save anything. Spending the code at either point would turn an ordinary dismissal into a trip back to the laptop.
The moment that counts
Note waits until the phone sends back a registration response the server can verify. The server checks that the pairing code is still valid, then saves the new credential and consumes the code in one database transaction. If you canceled pairing on the laptop while the phone prompt was open, that final check catches it. Once registration succeeds, opening the same link again can’t add a third device.
That also gave us a useful browser test. We use two browser profiles with virtual authenticators. The first displays the QR code. The test checks that the image encodes the link the second profile opens, dismisses the first registration prompt, and tries again. At the end, the account has two passkeys and the used link is rejected. A physical camera scan is a separate check.
The question I’d ask of any one-time link is what the person should be able to do after an interruption. For Note, the answer starts with the button. If you still need to Create passkey, and the five minutes are up, get a fresh code. If there’s time left and pairing is still open, tap again.