Technical & DevelopmentIntermediate
email-and-password-best-practices
Configure email verification, implement password reset flows, set password policies, and customise hashing algorithms for Better Auth email/password authentication.
Developer Setup
Setup & Installation
bash
npx skills add https://github.com/better-auth/skills --skill email-and-password-best-practicesnpx skills add https://github.com/better-auth/skills --skill email-and-password-best-practicesOr paste this URL into your assistant to install:
Overview
What This Skill Does
Handles credential-based authentication using email and passwords. Configures secure verification flows, password reset tokens, absolute callback URLs, and client-side validations.
Application
When to use this Skill
- Enabling native username/email and password credentials signup and signin without third-party redirection.
- Restricting sign-in permission to only users who have successfully completed email verification.
- Implementing a secure, token-based forgot-password and reset-password flow.
- Integrating transactional email services like Resend or custom SMTP relays for sending auth emails.
- Applying absolute URL constraints for authentication callback links to prevent cross-domain redirection errors.
Documentation
Show Skills.md file
Better Auth Email and Password
Quick Start
- Enable email/password:
emailAndPassword: { enabled: true } - Configure
emailVerification.sendVerificationEmail - Add
sendResetPasswordfor password reset flows - Run
npx @better-auth/cli@latest migrate - Verify: attempt sign-up and confirm verification email triggers
Email Verification Setup
Configure emailVerification.sendVerificationEmail to verify user email addresses.
import { betterAuth } from "better-auth";
import { sendEmail } from "./email"; // your email sending function
export const auth = betterAuth({
emailVerification: {
sendVerificationEmail: async ({ user, url, token }, request) => {
await sendEmail({
to: user.email,
subject: "Verify your email address",
text: `Click the link to verify your email: ${url}`,
});
},
},
});
Lines 1 - 32 of 56
Recommendations
Explore other random skills
TechnicalAdvanced
clickhouse-best-practices
MUST USE when reviewing ClickHouse schemas, queries, or configurations. Contains 31 rules that MUST be checked before providing recommendations. Always read relevant rule files and cite specific rules in responses.
TechnicalIntermediate
clickhouse-js-node-coding
>
TechnicalAdvanced
clickhouse-js-node-troubleshooting
>