After verifying email when using mongodb adapter, the user object data fields become null #167

Closed
opened 2026-03-13 07:36:01 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @sherif-wael on GitHub (Nov 2, 2024).

Describe the bug
The user fields turn to nullafter verifying the email, this happens when using mongodb adapter
image

To Reproduce

  1. Create better auth instance with mongodb adaper
  2. Enable emailAndPassword with requireEmailVerification
  3. After signing up and clicking the verification URL, the user object fields turns to null except the emailVerified field is set to true
  4. image

Expected behavior
The user object remains the same and emailVerified is set to true

Originally created by @sherif-wael on GitHub (Nov 2, 2024). **Describe the bug** The user fields turn to nullafter verifying the email, this happens when using mongodb adapter ![image](https://github.com/user-attachments/assets/9ebe042c-0e3d-45bf-b7de-c31eef864a09) **To Reproduce** 1. Create better auth instance with mongodb adaper 2. Enable `emailAndPassword` with `requireEmailVerification` 3. After signing up and clicking the verification URL, the user object fields turns to null except the `emailVerified` field is set to `true` 4. ![image](https://github.com/user-attachments/assets/b1f984b8-4d64-4246-a5ca-f7f517dce3f1) **Expected behavior** The user object remains the same and `emailVerified` is set to true
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#167