Skip to content

✨ Add MFA for all users, with admin lockout when none active (LK-C17) - #139

Merged
Logan2234 merged 2 commits into
mainfrom
claude/ticket-40-questions-f36bdc
Aug 26, 2026
Merged

✨ Add MFA for all users, with admin lockout when none active (LK-C17)#139
Logan2234 merged 2 commits into
mainfrom
claude/ticket-40-questions-f36bdc

Conversation

@Logan2234

@Logan2234 Logan2234 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Ajoute le MFA (TOTP + code email, indépendamment activables) à tous les utilisateurs dans /app/settings, avec des codes de secours (bcrypt, usage unique) générés à la première activation.
  • Le login gagne une étape MFA intermédiaire : sélecteur de méthode soigné quand TOTP + email sont actifs, saisie directe sinon, avec repli sur un code de secours.
  • AdminGuard bloque désormais les routes /admin (403 MFA_REQUIRED) pour un compte admin sans aucune méthode MFA active — vérifié en direct, sans délai de grâce (pas de champ pour dater la promotion en admin).
  • Crée les tickets Quackback de suivi : MFA généralisé (satisfait par ce changement) et support WebAuthn/passkey (dépendant du premier).

Closes https://github.com/Logan2234/loomkeep-roadmap/issues/40 (LK-C17).

Test plan

  • pnpm --filter @loomkeep/api test — 754/754 tests passent (dont les nouveaux mfa.service.spec.ts, mfa-crypto.util.spec.ts, extensions auth.service.spec.ts / admin.guard.spec.ts)
  • pnpm --filter @loomkeep/web check — 0 erreur
  • pnpm lint — propre
  • pnpm --filter @loomkeep/api test:e2e — à faire après application de la migration
  • Vérification manuelle du flow (scan QR, code email, codes de secours, verrou admin)

TOTP and email one-time codes, independently toggleable in /app/settings,
backed by bcrypt-hashed recovery codes shown once on first activation.
Login gains an intermediate MFA challenge step (method picker when both are
active, straight to code entry otherwise). Admin routes now 403 with
MFA_REQUIRED when the account has no active method — checked live, no grace
period, since there's no field recording when an account became admin.

Also creates the follow-up Quackback tickets for generic-MFA-for-all-users
(fulfilled by this change) and WebAuthn/passkey support.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation api apps/api (NestJS) web apps/web (SvelteKit) shared packages/shared labels Aug 26, 2026
@Logan2234
Logan2234 merged commit f476acd into main Aug 26, 2026
12 of 13 checks passed
@Logan2234
Logan2234 deleted the claude/ticket-40-questions-f36bdc branch August 26, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api apps/api (NestJS) documentation Improvements or additions to documentation shared packages/shared web apps/web (SvelteKit)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant