[PR #6850] [MERGED] fix: use operator in list members where clause #23821

Closed
opened 2026-04-15 22:00:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6850
Author: @Diabl0570
Created: 12/18/2025
Status: Merged
Merged: 12/23/2025
Merged by: @himself65

Base: canaryHead: fix/organization-list-members-operator


📝 Commits (5)

  • 21638ec fix: use operator in list members where clause
  • 6cd76b4 fix feedback and add unit test
  • 69322b6 fix: use tabs instead of spaces
  • 54b80df fix linter error
  • 19266ef Merge branch 'canary' into fix/organization-list-members-operator

📊 Changes

2 files changed (+23 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/plugins/organization/adapter.ts (+6 -0)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.test.ts (+17 -2)

📄 Description

The listMembers function in the organization adapter accepts a filter parameter with an optional operator field that supports comparison operators (eq, ne, lt, lte, gt, gte, contains). However, this operator was not being passed through to the actual database queries, causing all filters to default to equality checks regardless of what operator was specified.


Summary by cubic

Pass the filter.operator from listMembers to the underlying where clause so non-equality comparisons work. Filters now respect operators like ne, lt, lte, gt, gte, and contains instead of always defaulting to eq.

Written for commit 19266ef993. 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/6850 **Author:** [@Diabl0570](https://github.com/Diabl0570) **Created:** 12/18/2025 **Status:** ✅ Merged **Merged:** 12/23/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/organization-list-members-operator` --- ### 📝 Commits (5) - [`21638ec`](https://github.com/better-auth/better-auth/commit/21638ecf3afe2a7d5be648ce2ecb4dfda4137009) fix: use operator in list members where clause - [`6cd76b4`](https://github.com/better-auth/better-auth/commit/6cd76b45b45425e53f237160143ed785f21739c1) fix feedback and add unit test - [`69322b6`](https://github.com/better-auth/better-auth/commit/69322b6e8a4f78948c70a44ef7d6f1c701a1e220) fix: use tabs instead of spaces - [`54b80df`](https://github.com/better-auth/better-auth/commit/54b80dfd805359c0b27bb07dd9bf44cbcafaab02) fix linter error - [`19266ef`](https://github.com/better-auth/better-auth/commit/19266ef99349ffca802fb91de29d7c25dc9d56c9) Merge branch 'canary' into fix/organization-list-members-operator ### 📊 Changes **2 files changed** (+23 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/organization/adapter.ts` (+6 -0) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.test.ts` (+17 -2) </details> ### 📄 Description The listMembers function in the organization adapter accepts a filter parameter with an optional operator field that supports comparison operators (eq, ne, lt, lte, gt, gte, contains). However, this operator was not being passed through to the actual database queries, causing all filters to default to equality checks regardless of what operator was specified. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Pass the filter.operator from listMembers to the underlying where clause so non-equality comparisons work. Filters now respect operators like ne, lt, lte, gt, gte, and contains instead of always defaulting to eq. <sup>Written for commit 19266ef99349ffca802fb91de29d7c25dc9d56c9. 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-04-15 22:00:15 -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#23821