What problem does it solve?
It solves the security and reliability problems that come from incomplete or inconsistent email/password authentication flows, including missing verification, weak password policies, and unsafe reset handling.
Core Features & Use Cases
- Email Verification Setup: Configure
emailVerification.sendVerificationEmail to send a verification link and optionally require verified emails before sign-in.
- Password Reset Flows: Implement
sendResetPassword and support secure reset requests with token expiration, optional session revocation, and an event hook.
- Password Hashing & Policies: Set password length requirements and override the default password hashing (e.g., Argon2id) with custom
hash and verify functions while planning safe migrations.
Example use case: enable verification and password resets for a SaaS app so users must confirm their email before accessing protected features, while lost-password requests reliably send reset links that expire and can revoke existing sessions.
Quick Start
Configure Better Auth to enable emailAndPassword, provide emailVerification.sendVerificationEmail and sendResetPassword, and run npx @better-auth/cli@latest migrate to apply the authentication changes.