Email/password accounts
Applications needing conventional account registration and login without a social provider.
Better Auth · Pipe
Better Auth’s built-in email/password authenticator supports registration, login, email verification, and password recovery. Enable it in the server configuration and provide email callbacks for verification or reset flows.
The emailAndPassword configuration controls Better Auth’s built-in email/password authenticator. Enable it on the server, then use the client’s email sign-up and sign-in methods; verification and password-reset flows require corresponding email-sending callbacks.
emailAndPassword: { enabled: true }emailAndPassword.enabled: true in the server configuration.signUp.email method.signIn.email method.import { betterAuth } from "better-auth";
export const auth = betterAuth({
emailAndPassword: {
enabled: true,
},
});Enable the email-and-password authenticator in the Better Auth server configuration.
Applications needing conventional account registration and login without a social provider.
Systems that must confirm ownership of an email address before allowing authenticated access.
Applications that need an account-recovery path for forgotten credentials.
Set emailAndPassword.enabled to true in the object passed to betterAuth. Without that setting, Better Auth will not permit email/password registration or login.
Follow-up: How would you prevent registration while retaining login? Set disableSignUp to true in the email-and-password configuration.
Call the client method signUp.email with the user’s information to register, and use signIn.email to authenticate. The server can also expose authentication through auth.api methods.
Follow-up: What happens after successful registration by default? The user is automatically signed in unless autoSignIn is set to false.
Email verification requires a sendVerificationEmail function that sends a verification link. Password-reset support similarly requires a sendResetPassword function in the email/password authenticator.
Follow-up: What configuration can enforce verification before a session is created? Set requireEmailVerification to true.
signUp.emailsignIn.emailsendVerificationEmailsendResetPasswordemailVerificationauth.api