two-factor-authentication-best-practices
Setting Up Two-Factor Authentication
When adding 2FA to your application, configure the twoFactor plugin with your app name as the issuer. This name appears in authenticator apps when users scan the QR code.
import { betterAuth } from "better-auth";
import { twoFactor } from "better-auth/plugins";
export const auth = betterAuth({
appName: "My App", // Used as the default issuer for TOTP
plugins: [
twoFactor({
issuer: "My App", // Optional: override the app name for 2FA specifically
}),
],
});
Note: After adding the plugin, run npx @better-auth/cli migrate to add the required database fields and tables.
More from lukevella/rallly
devmoji
Devmoji commit message emoji conventions. Use when writing git commit messages, formatting commit descriptions, or choosing the right emoji prefix for a commit. Triggers on "commit message", "git commit", "commit emoji", "devmoji".
17logging
Wide events logging pattern and conventions for this project. Use when writing logging code, adding observability, or implementing request tracing.
1create-auth-skill
Skill for creating auth layers in TypeScript/JavaScript apps using Better Auth.
1email-and-password-best-practices
This skill provides guidance and enforcement rules for implementing secure email and password authentication using Better Auth.
1organization-best-practices
This skill provides guidance and enforcement rules for implementing multi-tenant organizations, teams, and role-based access control using Better Auth's organization plugin.
1better-auth-best-practices
Skill for integrating Better Auth - the comprehensive TypeScript authentication framework.
1