refactor(2fa-webauthn) [PM-29890]: Add comment around last-credential deletion.

This commit is contained in:
enmande
2026-01-30 15:54:29 -05:00
parent bd9fbc802a
commit 5c2d502edf

View File

@@ -27,6 +27,9 @@ public class DeleteTwoFactorWebAuthnCredentialCommand : IDeleteTwoFactorWebAuthn
return false;
}
// Do not delete the last registered key credential.
// This prevents accidental account lockout (factor enabled, no credentials registered).
// To remove the last (or single) registered credential, disable the WebAuthn 2fa provider.
if (provider.MetaData.Count(k => k.Key.StartsWith("Key")) < 2)
{
return false;