two-factor-authentication-best-practices

Implement two-factor authentication with TOTP, OTP delivery, and backup codes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/do-zoo/match-screening-cisc --skill two-factor-authentication-best-practices-do-zoo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: two-factor-authentication-best-practices
Source: https://github.com/do-zoo/match-screening-cisc/tree/main/.agents/skills/two-factor-authentication-best-practices
Command: npx skills add https://github.com/do-zoo/match-screening-cisc --skill two-factor-authentication-best-practices-do-zoo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures secure user authentication by implementing robust two-factor authentication to protect accounts from credential theft and unauthorized access.

Core Features & Use Cases

  • TOTP setup for authenticator apps with QR codes
  • One-time passcodes via email or SMS for backup when the primary method is unavailable
  • Generation and management of backup codes for recovery
  • Guided sign-in flow to prompt for a second factor when required
  • Trusted devices handling to improve user experience while maintaining security

Quick Start

Add the twoFactor plugin to your server config and enable client-side 2FA integration to require a second factor at sign-in.

Frequently Asked Questions about two-factor-authentication-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement TOTP two-factor authentication in my app?

To implement TOTP two-factor authentication, add the Better Auth twoFactor plugin to your server config and enable client-side integration to require a second factor at sign-in.

What is the best way to handle backup codes for two-factor authentication?

The best way to handle backup codes for two-factor authentication is to generate and manage recovery codes through the twoFactor plugin, allowing users to regain access if their primary method is unavailable.

Can I use email or SMS for OTP delivery during MFA sign-in?

Yes, you can use email or SMS for OTP delivery as a backup method for two-factor authentication when the primary authentication method is unavailable.

How does trusted device handling work in a two-factor authentication flow?

Trusted device handling in a two-factor authentication flow improves user experience by allowing users to bypass the second factor on recognized devices while maintaining overall account security.

Does two-factor authentication work with onboarding and login workflows?

Yes, two-factor authentication works with onboarding and login workflows by applying the twoFactor plugin to prompt for a second factor during sign-in, onboarding, and trusted-device workflows.

What are the limitations of using TOTP for two-factor authentication?

A limitation of using TOTP for two-factor authentication is that users can lose access to their authenticator app, which requires configuring backup OTP delivery via email or SMS and generating backup codes.