# Two-step sign-in: passkeys and codes

How to turn on two-step sign-in with a passkey or an authenticator app, what your recovery codes are for, and what happens when a second step goes wrong.

With two-step sign-in on, someone who has your password still can't get into your account: after the password, hematite asks for a second step only you have. It's in [Settings → Security](https://hematite.gg/settings/security), and every account can turn it on.

## The second steps

- **A passkey:** your fingerprint, your face or your screen lock, on a laptop or a phone, or a security key. There's nothing to type, and a fake site can't reuse it. Your device keeps the check itself; hematite gets only a signature.
- **An authenticator app:** an app on your phone that shows a six-digit code, new every 30 seconds. Any app that reads a QR code for two-step sign-in works.
- **Recovery codes:** ten codes like `4KQ7-9MXT-2B`, each signing you in once, for when your passkey and your phone are both gone.

hematite never sends codes by text message or email: whoever takes over your number or your inbox would have them too.

## Turn it on

1. In [Settings → Security](https://hematite.gg/settings/security), press **Turn on** under **Two-step sign-in**. hematite asks for your password first.
2. Choose **Passkey** or **Authenticator app**.
   - A passkey: follow your browser's prompt, then give it a name you'll recognise, like "MacBook".
   - An app: scan the QR code with it, or type the key under the code, then type the six digits it shows.
3. Save your ten recovery codes: **Copy** them, or **Download** them as `hematite-recovery-codes.txt`, and keep them somewhere apart from your devices. They're shown only this once.

**Add another** puts a second passkey or an app beside the first, so one lost device doesn't lock you out.

## Signing in

After your password, the sign-in card asks for the second step: your passkey first when you have one, the six digits from your app otherwise. **Use a recovery code** is under them. A new device that signs in this way gets you an email, so a sign-in that wasn't you doesn't go unnoticed.

Five wrong answers and the sign-in starts again with the password. Ten wrong answers within 15 minutes pause signing in to your account for 15 minutes, and hematite emails you: someone who gets that far knows your password, so change it if it wasn't you. Where you're already signed in, nothing changes.

## Recovery codes

Each code works once. Signing in with one says how many are left, and emails you. With two or fewer left, Settings → Security asks you to make new ones: **New codes** gives you ten more, and the old ones stop working at once.

> **Warning: Lost every device and every code?**
>
> Write to support@hematite.gg from your account's address. Getting back in
> without a second step takes checks that you're you, so keep your codes safe.

## Confirming it's you

Some changes ask you to confirm it's you, even when you're signed in: turning two-step sign-in on or off, a method added or removed, new recovery codes, a new email address, and, with two-step sign-in on, a new password, an upload token, an uploader's download, an [API key](https://hematite.gg/docs/developers/api-keys) or a child key that may change things, and an app or its new secret. With two-step sign-in on that's your second step, otherwise your password. Once confirmed, the same browser isn't asked again for ten minutes. Signing out never asks.

## Turn it off

Remove your last passkey or app in [Settings → Security](https://hematite.gg/settings/security). hematite asks for your second step and then your password, and your recovery codes stop working with it. Every change, and every wrong second step, is in your [audit log](https://hematite.gg/docs/account/your-data#the-audit-log), and each change is emailed to you.
