Admin plugin : listUsers total is not correct #971

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

Originally created by @elvince on GitHub (Apr 3, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Hi,
When using list users the total returned do not take into account the filter clause.

sample:
auth.api.listUsers({ headers: await headers(), query: { filterField: "role", filterOperator: "eq", filterValue: "admin", limit: 1, }, }),

You should have the total number of admin. As of today, we have the total of all users (admin and user role).

Current vs. Expected behavior

As per the documentation, the total should take into account the filter clause

What version of Better Auth are you using?

1.2.5

Provide environment information

- OS: W11
- adapter: Prisma

Which area(s) are affected? (Select all that apply)

Backend, Client

Auth config (if applicable)


Additional context

No response

Originally created by @elvince on GitHub (Apr 3, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Hi, When using list users the total returned do not take into account the filter clause. sample: ` auth.api.listUsers({ headers: await headers(), query: { filterField: "role", filterOperator: "eq", filterValue: "admin", limit: 1, }, }),` You should have the total number of admin. As of today, we have the total of all users (admin and user role). ### Current vs. Expected behavior As per the documentation, the total should take into account the filter clause ### What version of Better Auth are you using? 1.2.5 ### Provide environment information ```bash - OS: W11 - adapter: Prisma ``` ### Which area(s) are affected? (Select all that apply) Backend, Client ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the bug label 2026-03-13 08:12:53 -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#971