[PR #8679] fix(core): prioritize generateId "uuid" over adapter customIdGenerator #16387

Closed
opened 2026-04-13 10:30:34 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/8679

State: closed
Merged: Yes


Related to https://github.com/better-auth/better-auth/issues/8668

MongoDB uses a customIdGenerator that injects ObjectId().toString(). However, due to the current priority, a user-provided "uuid" option wasn't being applied.

I also slightly refactored the logic for better type narrowing and added tests to lock the behavior.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/8679 **State:** closed **Merged:** Yes --- Related to https://github.com/better-auth/better-auth/issues/8668 MongoDB uses a customIdGenerator that injects `ObjectId().toString()`. However, due to the current priority, a user-provided `"uuid"` option wasn't being applied. I also slightly refactored the logic for better type narrowing and added tests to lock the behavior.
GiteaMirror added the pull-request label 2026-04-13 10:30:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16387