Skip to content

Multi-Factor Authentication

Multi-factor authentication (MFA) adds a second verification step after your password — protecting your account even if your password is compromised.

b'nerd supports TOTP (Time-based One-Time Passwords, compatible with any standard authenticator app) and recovery codes as a backup method.

Admin accounts — hard gate

Admin-role accounts must complete TOTP enrollment before the dashboard is accessible. On first login, admins are redirected to /mfa/setup and cannot reach any other page until enrollment is complete.

Organization-enforced MFA

Organization admins can require all org members to enroll in MFA. See Organization-enforced MFA below.


Enroll in MFA (TOTP)

  1. Open the dashboard and go to Account → Security (/account/security).
  2. In the Multi-Factor Authentication card, click Enable MFA.
  3. The enrollment flow expands inline — no page navigation needed.

Step 1 — Scan the QR code

Scan the QR code with your authenticator app (Aegis, Authy, 1Password, Google Authenticator, and any other TOTP-compatible app).

If you cannot scan the QR code, click Can't scan? to reveal the manual Base32 secret key and enter it directly into your authenticator app.

Click Next → once your app has registered the account.

Step 2 — Confirm your first code

Enter the 6-digit code shown in your authenticator app, then click Verify & Enable.

  • The code changes every 30 seconds — if it expires while you type, wait for the next one.
  • If your code is rejected, check that your device clock is synchronized (see Troubleshooting).

Step 3 — Save your recovery codes

After the code is verified, 16 single-use recovery codes are displayed.

Save your codes now

Recovery codes are shown once only. Download them as a .txt file or copy them to your password manager before clicking Done.

Each code can be used exactly once to sign in when your authenticator is unavailable. Once a code is used, it is permanently invalidated.

Click Done — I've saved my codes to finish enrollment.


Sign in with MFA

After entering your email and password on the login page, you are redirected to the two-factor challenge at /mfa/challenge.

TOTP challenge

Enter the current 6-digit code from your authenticator app and click Verify.

Recovery code challenge

If you cannot access your authenticator app, click Use a recovery code instead and enter one of your saved codes.

After a successful recovery code sign-in, the dashboard shows a banner reminding you to generate new codes. Recovery codes are single-use — once entered, each code is removed and cannot be reused.


Recovery codes

Remaining code count

The number of unused recovery codes is shown on Account → Security next to the Recovery codes section. The API also exposes this value at GET /accounts/me under mfa.recovery_codes_remaining.

Low code warning

When two or fewer recovery codes remain, regenerate a fresh set immediately. You cannot generate codes one at a time — regeneration replaces all existing codes with a new set of 16.

Regenerate recovery codes

  1. Go to Account → Security and expand the MFA manage section.
  2. Click Regenerate codes.
  3. Enter your current password to confirm.
  4. Download or copy the new codes before clicking Done.

All previous codes are permanently invalidated the moment the new set is generated.


Disable MFA

Reduces account security

Disabling MFA removes the second-factor requirement. Only do this if you intend to immediately re-enroll with a new device.

  1. Go to Account → Security and expand the MFA manage section.
  2. Click Disable MFA (red outlined button at the bottom).
  3. A confirmation dialog appears. Enter your current password and click Disable MFA to confirm.

Locked account

After too many incorrect sign-in attempts the platform locks your account.

Unlock via email

  1. On the lock screen (/mfa/locked), click Send unlock email.
  2. An unlock link is sent to your registered email address.
  3. Click the link. You are taken to a confirmation page and can sign in again.

If the link has expired, click Send unlock email again to request a new one.

If you cannot receive the unlock email

Contact hello@bnerd.com and include your account email address.


Organization-enforced MFA

Organization admins can require all members of their organization to enroll in TOTP. Once enabled, any member who attempts an interactive browser login without MFA enrolled receives a 403 totp_setup_required response and is redirected to /mfa/setup to complete enrollment before the dashboard is accessible.

How it works

  • The gate fires on interactive password-authenticated sessions only — static API tokens, CLI Bearer JWTs, and Terraform provider calls are unaffected.
  • Platform (super) admins are subject to the existing admin hard-gate and are not additionally affected by the org-level toggle.
  • The mfa_required field is returned on every GET /organizations/:id response so clients can reflect the current policy.

Dashboard settings toggle

A Require MFA toggle in Organization → Settings is in development. Until it ships, enable org-enforced MFA via the API (see below) or contact hello@bnerd.com.

Enable org-enforced MFA

PATCH /organizations/{id}
Authorization: Bearer <org-admin-token>
Content-Type: application/json

{
  "organization": {
    "mfa_required": true
  }
}

Returns the updated Organization object with mfa_required: true. Only org-admin role members can set this field. Set "mfa_required": false to disable enforcement.

Member experience once enabled

Members who log in and have not yet enrolled in TOTP are blocked at the API layer (403 totp_setup_required) and the dashboard redirects them to /mfa/setup. That page runs the full enrollment flow (QR code → verify code → save recovery codes) in an isolated layout. After successful enrollment the member is forwarded to the dashboard normally.


API access and MFA

Static API tokens and CLI Bearer JWTs are not subject to the MFA gate. Only interactive browser logins require the second-factor challenge.

This means:

  • Terraform provider API calls are unaffected by MFA enrollment.
  • bnerd CLI token-based requests proceed without challenge.
  • Dashboard browser sessions require MFA after enrollment.

See Authentication & Tokens for the full auth surface.


Troubleshooting

Symptom Likely cause Fix
"Incorrect code" on valid-looking TOTP code Device clock out of sync Synchronize your device clock (NTP). TOTP uses UTC time; even a 60-second drift causes rejections.
Lost authenticator app TOTP device unavailable Use a recovery code to sign in, then re-enroll with a new device.
All recovery codes used Ran out of backup codes Contact hello@bnerd.com — support can unlock your account.
Unlock email not received Email in spam or SMTP delay Check your spam folder. Allow a few minutes. If still missing, contact support.
"Too many attempts. Use a recovery code or contact support." OTP attempt limit reached Use a recovery code or contact support. The TOTP attempt counter resets after a successful challenge.
Admin account redirected to /mfa/setup on first login Admin MFA hard-gate Complete TOTP enrollment — the gate cannot be bypassed.
Org member blocked after org-enforced MFA is enabled totp_setup_required from org gate Complete enrollment at /mfa/setup — you are redirected there automatically.

API reference

The MFA API is documented in the Interactive API Reference under the MFA tag.

Quick links:

Operation Endpoint
Provision TOTP (step 1) POST /accounts/mfa/setup
Verify and enable TOTP (step 2) POST /accounts/mfa/setup (with otp_code + raw_secret)
Disable MFA DELETE /accounts/mfa
Regenerate recovery codes POST /accounts/mfa/recovery-codes/regenerate
MFA status on current account GET /accounts/memfa field

See the MFA API reference page for request/response shapes and error codes.