> ## Documentation Index
> Fetch the complete documentation index at: https://docs.relayhub.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Factor Authentication

> Secure your account with two-factor authentication

RelayHub supports TOTP-based multi-factor authentication (MFA) to add a second layer of security to user accounts. When enabled, users must provide a time-based one-time password from an authenticator app in addition to their email and password.

## Setting Up MFA

<Steps>
  <Step title="Open your account settings">
    Click your profile avatar in the bottom-left corner of the sidebar, then select **Account Settings**.
  </Step>

  <Step title="Navigate to Security">
    Select the **Security** tab in your account settings.
  </Step>

  <Step title="Click Enable MFA">
    Click the **Enable Multi-Factor Authentication** button to begin setup.
  </Step>

  <Step title="Scan the QR code">
    A QR code will appear on screen. Open your authenticator app (Google Authenticator, Authy, 1Password, or any TOTP-compatible app) and scan the code to add RelayHub.
  </Step>

  <Step title="Enter the verification code">
    Your authenticator app will display a 6-digit code. Enter it in the verification field to confirm the setup is working.
  </Step>

  <Step title="Save your backup codes">
    RelayHub generates a set of one-time backup codes. **Save these in a secure location.** Each backup code can be used once to log in if you lose access to your authenticator app.
  </Step>
</Steps>

<Warning>
  Store your backup codes securely -- they are the only way to recover your account if you lose your authenticator device. RelayHub cannot reset MFA without a backup code or admin intervention.
</Warning>

## Logging In with MFA

Once MFA is enabled, the login flow adds one extra step:

1. Enter your email and password as usual
2. When prompted, open your authenticator app and enter the current 6-digit code
3. You are logged in after the code is verified

Codes rotate every 30 seconds. If a code expires while you are typing it, wait for the next code and try again.

## Using Backup Codes

If you cannot access your authenticator app:

<Steps>
  <Step title="Click 'Use a backup code'">
    On the MFA verification screen, click the **Use a backup code** link.
  </Step>

  <Step title="Enter a backup code">
    Type one of your saved backup codes. Each code can only be used once.
  </Step>

  <Step title="Reconfigure MFA">
    After logging in with a backup code, go to **Account Settings > Security** and re-enable MFA with a new QR code to refresh your setup.
  </Step>
</Steps>

<Note>
  Each backup code is single-use. After using one, it is permanently consumed. If you are running low on backup codes, disable and re-enable MFA to generate a fresh set.
</Note>

## Disabling MFA

To turn off MFA for your account:

1. Go to **Account Settings > Security**
2. Click **Disable MFA**
3. Enter your current authenticator code or a backup code to confirm
4. MFA is removed from your account immediately

## Compatible Authenticator Apps

Any app that supports the TOTP standard (RFC 6238) works with RelayHub:

* **Google Authenticator** (iOS, Android)
* **Authy** (iOS, Android, Desktop)
* **1Password** (built-in TOTP support)
* **Microsoft Authenticator** (iOS, Android)
* **Bitwarden** (built-in TOTP support)

<Tip>
  Authy and 1Password support cloud backup of your TOTP secrets, making it easier to recover if you switch devices. Google Authenticator requires manual transfer.
</Tip>
