[PR #2623] [CLOSED] Allow filtering users from using 'contains' operator #4406

Closed
opened 2026-03-13 11:44:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2623
Author: @thisisleobro
Created: 5/12/2025
Status: Closed

Base: mainHead: fix-list-users-operators


📝 Commits (1)

  • 7e3fdc7 Add 'contains' to list of allowed filter operators.

📊 Changes

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

View changed files

📝 packages/better-auth/src/plugins/admin/admin.ts (+1 -1)

📄 Description

Motivation to allow 'contains' was so that i could filter by role when calling authClient.admin.listUsers().
Currently 'eq' (equals) is the only valid operator for filtering by role but it only works if role is the unique role set on user.
A user with roles 'admin' and 'user' can not be filtered using 'admin' nor 'user' as filter value

Closes #2588


🔄 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/2623 **Author:** [@thisisleobro](https://github.com/thisisleobro) **Created:** 5/12/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-list-users-operators` --- ### 📝 Commits (1) - [`7e3fdc7`](https://github.com/better-auth/better-auth/commit/7e3fdc7a586eba5ea6d8bb10b31fbf1e5e4e5867) Add 'contains' to list of allowed filter operators. ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/admin/admin.ts` (+1 -1) </details> ### 📄 Description Motivation to allow 'contains' was so that i could filter by role when calling authClient.admin.listUsers(). Currently 'eq' (equals) is the only valid operator for filtering by role but it only works if role is the unique role set on user. A user with roles 'admin' and 'user' can not be filtered using 'admin' nor 'user' as filter value Closes #2588 --- <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 11:44:49 -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#4406