email-and-password-best-practices

Configure Better Auth email verification, password resets, and security hardening.

7|1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/1lastphoenix/ton-ai-audit --skill email-and-password-best-practices-1lastphoenix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: email-and-password-best-practices
Source: https://github.com/1lastphoenix/ton-ai-audit/tree/main/.agents/skills/email-and-password-best-practices
Command: npx skills add https://github.com/1lastphoenix/ton-ai-audit --skill email-and-password-best-practices-1lastphoenix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides developers to implement secure email and password authentication using Better Auth, reducing sign-up abuse and strengthening credential protection.

Core Features & Use Cases

  • Email verification setup with sendVerificationEmail to ensure valid addresses
  • Enforce email verification to block sign-ins until verification
  • Password reset flows with sendResetPassword and token expiry for security
  • Security guardrails: token security, redirect validation, and optional session revocation

Quick Start

Configure email verification, enable password reset flows, and set token expiry in your Better Auth configuration.

Frequently Asked Questions about email-and-password-best-practices

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

FAQPage Schema
How do I enforce email verification before allowing user sign-in?

To enforce email verification, configure the requireEmailVerification setting in your Better Auth configuration to block sign-ins until the user verifies their email address, reducing sign-up abuse.

How do I set up secure password reset flows with token expiry?

Implement secure password reset flows by configuring sendResetPassword with strict token expiry limits in your backend authentication setup. This ensures tokens are invalid after a short window, protecting against unauthorized access.

What security hardening configurations should I apply for email and password authentication?

Security hardening for email and password authentication includes setting token expiry, validating redirect URLs, enforcing password policy defaults, and enabling revokeSessionsOnPasswordReset to invalidate active sessions after a credential change.

Does Better Auth support revoking active sessions when a user resets their password?

Yes, Better Auth supports revoking active sessions upon password reset. By enabling the revokeSessionsOnPasswordReset configuration, the system invalidates all existing user sessions immediately after a successful password reset.

Can I use Better Auth for email verification and password resets in mobile apps?

Yes, Better Auth is applicable to backend services supporting both web and mobile apps. You can configure sendVerificationEmail and sendResetPassword flows to securely manage authentication across mobile platforms.

Why does my password reset redirect fail validation in Better Auth?

Password reset redirect validation fails when the target URL is not explicitly whitelisted in your authentication configuration. You must validate redirect URLs to prevent open redirect attacks during the password reset flow.