# Two-factor authentication

With two-factor authentication (2FA), signing in takes your password **and** a 6-digit code from
an authenticator app such as 1Password, Google Authenticator or Authy (any app that shows "TOTP"
codes). Someone who learns your password still can't get in.

## Turn it on

1. Open your **Settings** (your name in the sidebar → **Settings**) and find
   **Two-factor authentication**.
2. Click **Set up** and scan the QR code with your authenticator app, or type in the key shown
   below it.
3. Enter the 6-digit code from the app and your password, and click **Turn on**.
4. Save the **ten backup codes** docket shows you, in a password manager or printed. They're shown
   only once.

When you sign in, docket asks for the code after your password. Codes change every 30 seconds, and
each works only once.

Turning 2FA on or off and creating new backup codes sign you out everywhere else, including the
macOS app. The browser you did it in stays signed in.

## Lost your phone?

- **Use a backup code** instead. Each works once. Your 2FA page shows how many are left, and you can
  create a new set any time (this voids the old ones).
- **No backup codes either?** Ask an Admin: under **Administration → Users → your name → Settings** they can
  **reset** your two-factor authentication. This signs you out everywhere. You then sign in with your
  password and set it up again.

To move to a new phone, open **Two-factor authentication → Manage**, turn it off (this needs your
password and a current code) and set it up again.

## Passkeys

A passkey signs you in with your fingerprint, face or your device's PIN, without the password. It
counts as both factors, so no code is asked for after it. Your password stays as it is; a passkey
only adds a way in.

1. In your **Settings**, find **Passkeys** and click **Manage passkeys**.
2. Give it a name (say "MacBook"), enter your current password and click **Add passkey**. Your
   device asks for its fingerprint, face or PIN.
3. Next time, click **Sign in with a passkey** on the login page, or pick the passkey your browser
   suggests in the email field.

A passkey belongs to this workspace: in a second workspace you add another. Lost a device? Remove
its passkey on the same page: that signs you out everywhere but the browser you're in. A workspace that requires two-factor
authentication still asks for the code app, because signing in with the password stays possible.

## For Admins: make it mandatory

Under **Administration → Settings**, tick **Require two-factor authentication** and save. Everyone who
hasn't set it up is taken to the setup the next time they open docket and can't use docket until
2FA is on. Members who already use it notice nothing.

Admins can reset other members' two-factor authentication, but not their own; turning off your own
always takes your password and a current code.

## Related

- [User roles & permissions](https://docket.rocks/en/docs/user-roles): who is an Admin.
- [Inviting your team](https://docket.rocks/en/docs/inviting-your-team): adding people to your workspace.