Build
Authentication
Sign-in methods, two-factor, passkeys and social login.
01Sign-in methods
Choose methods in features/auth/config.ts. The login UI and the auth server both read it.
export const authMethods = {
password: true,
magicLink: true,
emailOtp: true,
passkey: true,
anonymous: false, // "Continue as guest"; guests can sign up later and keep their data
} as const;03Security
Two-factor uses an authenticator app with backup codes. Passkeys use WebAuthn. Auth routes are rate-limited in the database, sessions can be revoked from the account page, and BETTER_AUTH_URL must match the URL people use, or requests fail with "Invalid origin".
02Social login
Google, GitHub and Apple turn on when their keys are set:
Users can connect and disconnect providers from
/dashboard/account; the last sign-in method can't be removed.