user table stores authentication data. See the database schema for the full field list. You can extend the user schema with additional fields or use plugins.
Updating users
Update user information
Update a user’sname or image using the updateUser function:
Change email
Email change is disabled by default. Enable it by settingchangeEmail.enabled to true and providing a sendVerificationEmail function:
auth.ts
Require confirmation from the current email
For added security, require users to approve the change from their current email before the verification link is sent to the new address:auth.ts
Allow change without verification
If the user’s current email is not verified and you want to allow immediate updates without verification:auth.ts
Client usage
Change password
Passwords are stored in theaccount table, not the user table. Use changePassword to update it:
Set password
Users who registered via OAuth do not have a password. Use the server-sidesetPassword method to add one. For security, this can only be called from the server — we recommend routing users through a forgot-password flow instead.
set-password.ts
Verify password
Verify the current user’s password before sensitive operations. This can only be called from the server.verify-password.ts
For OAuth users without passwords, consider using email verification or fresh session checks for sensitive operations.
Deleting users
User deletion is disabled by default. Enable it withdeleteUser.enabled:
auth.ts
authClient.deleteUser() to permanently remove a user’s data.
Verification before deletion
For added security, send a verification email before deleting the account. This is especially useful for OAuth users who cannot prove identity with a password.auth.ts
Authentication requirements
To delete an account, the user must satisfy one of the following:1
Provide a valid password
2
Have a fresh session
The user must have signed in recently. The
freshAge defaults to 1 day.3
Complete email verification
Required for OAuth users who have no password. Only works when
sendDeleteAccountVerification is configured.Callbacks
Run custom logic before and after user deletion:auth.ts
Accounts
Each authentication method is a provider. When a user signs in via a provider, an account record is created in theaccount table. Accounts store provider-returned data such as access tokens, refresh tokens, and scopes.
List user accounts
Token encryption
Better Auth does not encrypt tokens by default — this is intentional, giving you full control over encryption. UsedatabaseHooks to encrypt tokens before they are saved:
Account linking
Account linking is enabled by default and lets users connect multiple authentication methods to a single user record. Linking requires the provider to confirm the email as verified. To disable account linking entirely:auth.ts
Trusted providers (forced linking)
Specify providers that are trusted regardless of email verification status:auth.ts
Manually linking social accounts
Signed-in users can link additional social providers:auth.ts
auth.ts
Linking credential-based accounts
For email/password accounts, use the server-sidesetPassword method or direct users through a forgot-password flow:
set-password.ts
Account unlinking
Unlink a provider from the current user’s account:allowUnlinkingAll:
auth.ts