email-and-password-best-practices

Configure email verification, password reset flows, and hashing policies for Better Auth.

Updated May 26, 2026
One-click install
npx skills add https://github.com/Albo-Club/albo-os --skill email-and-password-best-practices-albo-club
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: email-and-password-best-practices
Source: https://github.com/Albo-Club/albo-os/tree/main/.agents/skills/email-and-password-best-practices
Command: npx skills add https://github.com/Albo-Club/albo-os --skill email-and-password-best-practices-albo-club

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires better-auth, @node-rs/argon2.

What problem does it solve? Setting up secure email/password authentication with Better Auth involves many moving parts—verification emails, reset flows, token expiry, session revocation, and password hashing—and misconfiguring any of them creates security gaps or broken user flows. ## Core Features & Use Cases - Email Verification Setup: Configure sendVerificationEmail and optionally block sign-in until users verify their email with requireEmailVerification. - Password Reset Flows: Implement sendResetPassword with built-in timing-attack protections, configurable token expiry, single-use tokens, and session revocation on reset. - Password Policies & Hashing: Set minimum/maximum password lengths and swap the default scrypt hashing for Argon2id via custom hash and verify functions. - Use Case: You are adding credential-based sign-up to a SaaS app and need verification emails, a secure reset flow with 30-minute token expiry, and Argon2id hashing—this Skill walks through each configuration step with working code. ## Quick Start Ask the AI to configure Better Auth email and password authentication with email verification and a password reset flow for your project.

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 set up email verification with Better Auth?

Configure `emailVerification.sendVerificationEmail` in your Better Auth config with a function that sends the verification URL to the user. To block sign-in until verification, also enable `emailAndPassword.requireEmailVerification`.

How to implement a password reset flow in Better Auth?

Provide a `sendResetPassword` function in the `emailAndPassword` config that emails the reset URL. Then call `requestPasswordReset` from the server API or authClient with the user's email and a `redirectTo` URL.

Does Better Auth support Argon2 password hashing?

Yes, Better Auth supports custom hashing algorithms via the `password.hash` and `password.verify` functions. You can plug in Argon2id using `@node-rs/argon2`; the default algorithm is scrypt with no external dependencies.

How long do Better Auth password reset tokens last?

Reset tokens expire after 1 hour by default and are single-use, deleted immediately after a successful reset. You can change the expiry with `resetPasswordTokenExpiresIn`, specified in seconds.

Why should I use absolute callback URLs in Better Auth?

Absolute callback URLs including the origin prevent Better Auth from inferring the origin, which fails when your backend and frontend run on different domains. Pass the full URL in `callbackURL` for sign-up and sign-in requests.

What happens to existing users if I switch password hashing algorithms?

Users whose passwords were hashed with the old algorithm will not be able to sign in after switching. Plan a migration strategy, such as re-hashing on next successful login, before changing algorithms on an existing system.