Better Auth email and password

Configures Better Auth email and password sign-in: verification emails, required verification, password reset with token lifetime and session revocation, length limits and custom hashing such as Argon2id. Use when setting up credential login on Better Auth.

SecurityPack: Better Auth skillslinkbetter-auth-email-password
Author
Source
better-auth/skills/better-auth/emailAndPassword @ 20c9e88
License
none stated

About this skill

What it does

The skill takes Better Auth's email and password sign-in past enabled: true. It wires sendVerificationEmail (the handler gets a ready url and the raw token) and requireEmailVerification, which blocks sign-in until the address is confirmed and resends the link on each attempt. Password reset gets sendResetPassword, an optional onPasswordReset hook and the requestPasswordReset call with redirectTo. Callback URLs stay absolute, so a frontend and backend on different domains work.

It lists what Better Auth already does against enumeration and timing attacks: mail sent in the background, dummy operations on invalid requests, the same response whether the user exists or not. On serverless the agent points advanced.backgroundTasks.handler at the platform's waitUntil. Reset tokens are single-use and expire after an hour by default (resetPasswordTokenExpiresIn); revokeSessionsOnPasswordReset ends every session after a reset; of password rules the skill sets only the length, minPasswordLength and maxPasswordLength. Hashing defaults to Node's native scrypt. For Argon2id the skill shows custom hash and verify on @node-rs/argon2 and warns that switching algorithms without a migration plan locks existing users out.

The folder holds only SKILL.md. Sending mail is up to you: the examples call your own sendEmail.

When to use it, and when not

Use it when a Better Auth app signs users in with email and password and you need verification, password reset or a different hash.

Magic links, email OTP and passkeys are not covered. On Neon's Managed Better Auth, Neon sends these emails itself (shared SMTP to start, your own in production), so the mail hooks do not apply; see Neon Auth.

How to run it

We do not copy this skill: the author's repository has no licence. Install it from there with the button to the source. The Claude Code plugin in the repository's .claude-plugin/marketplace.json (auth-skills) carries only create-auth and best-practices, so copy the better-auth/emailAndPassword folder into your agent's skills directory. The name is email-and-password-best-practices:

  • Claude Code: /email-and-password-best-practices, or ask for the skill by name.
  • Codex: $email-and-password-best-practices.
  • Cursor: type / in the Agent chat and pick email-and-password-best-practices.

Example: /email-and-password-best-practices Require email verification, add password reset with a 30-minute token and end all sessions after a reset.

How it differs from similar skills

Add authentication with Better Auth asks whether verification is needed and wires a mail provider as one step of a full setup; this skill goes into token lifetime, session revocation and hashing. Better Auth security hardening covers rate limits on sign-in and the rest of the deployment. Security hardening gives stack-independent rules, password hashing with a bcrypt example among them.

Install

This skill is not copied to the catalog: the author's repository has no licence text. Install it from there.

Open the source

Connect through AnyModel API

This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.

More from the pack Better Auth skills