[PR #6026] [MERGED] fix(anonymous): isAnonymous should default to false instead of null #6392

Closed
opened 2026-03-13 12:57:16 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6026
Author: @ping-maxwell
Created: 11/16/2025
Status: Merged
Merged: 11/16/2025
Merged by: @Bekacru

Base: canaryHead: fix/is-anonymous-default-value


📝 Commits (1)

  • 7e5a9cd fix(anonymous): isAnonymous should default to false

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/plugins/anonymous/schema.ts (+1 -0)

📄 Description

When creating a user outside of the anonymous plugin, such as email-otp, the default value for isAnonymous once the user is created is null. It should be set to false instead.


Summary by cubic

Set isAnonymous to default to false in the anonymous plugin schema to avoid null values for users created via non-anonymous flows (e.g., email-otp).
This ensures consistent boolean behavior and removes the need for null checks.

Written for commit 7e5a9cd07a. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6026 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 11/16/2025 **Status:** ✅ Merged **Merged:** 11/16/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/is-anonymous-default-value` --- ### 📝 Commits (1) - [`7e5a9cd`](https://github.com/better-auth/better-auth/commit/7e5a9cd07a62c5b31d45b863f891551b013c751e) fix(anonymous): `isAnonymous` should default to false ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/anonymous/schema.ts` (+1 -0) </details> ### 📄 Description When creating a user outside of the anonymous plugin, such as email-otp, the default value for `isAnonymous` once the user is created is `null`. It should be set to `false` instead. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Set isAnonymous to default to false in the anonymous plugin schema to avoid null values for users created via non-anonymous flows (e.g., email-otp). This ensures consistent boolean behavior and removes the need for null checks. <sup>Written for commit 7e5a9cd07a62c5b31d45b863f891551b013c751e. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:57:16 -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#6392