email-and-password-best-practices

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

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/saad-tayyab/lumora --skill email-and-password-best-practices-saad-tayyab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: email-and-password-best-practices
Source: https://github.com/saad-tayyab/lumora/tree/main/.agents/skills/email-and-password-best-practices
Command: npx skills add https://github.com/saad-tayyab/lumora --skill email-and-password-best-practices-saad-tayyab

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Setting up secure email/password authentication involves many moving parts—verification emails, reset flows, token expiry, session revocation, and hashing algorithms—and misconfiguring any of them creates security gaps. This Skill provides the correct Better Auth configuration patterns for each of these concerns. ## Core Features & Use Cases - Email Verification Setup: Configure sendVerificationEmail and optionally block sign-in until verification with requireEmailVerification. - Password Reset Flows: Implement sendResetPassword, control token expiry, revoke sessions on reset, and handle background tasks on serverless platforms. - Password Policies & Hashing: Set min/max 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 and login to a SvelteKit app with Better Auth and need verification emails, a secure reset flow, and Argon2id hashing configured correctly on the first pass. ## Quick Start Ask the AI to configure Better Auth email and password authentication with email verification, a password reset flow, and Argon2id hashing in your auth config file.

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 do I implement a password reset flow in Better Auth?

Provide a `sendResetPassword` function in the `emailAndPassword` config that emails the reset URL. Trigger it by calling `requestPasswordReset` with the user's email and a `redirectTo` URL pointing to your reset page.

Can I use Argon2 instead of scrypt for password hashing in Better Auth?

Yes, Better Auth defaults to scrypt but accepts custom `hash` and `verify` functions under `emailAndPassword.password`. You can plug in Argon2id via `@node-rs/argon2` with configurable memory, time, and parallelism costs.

Does Better Auth password reset work on serverless platforms?

Yes, but you should configure `advanced.backgroundTasks.handler` to route promises through platform-specific methods like `waitUntil`. This ensures reset emails finish sending after the response is returned.

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.