Add multi-field sorting support to admin.listUsers sortBy parameter #1374

Closed
opened 2026-03-13 08:35:39 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @jph-sw on GitHub (Jun 18, 2025).

Is this suited for github?

  • Yes, this is suited for github

No response

Describe the solution you'd like

It would be very nice if you could sort by multiple fields in the listUsers function.
Example:

username -> role -> name

This would really nice in a table 😁

Describe alternatives you've considered

Manual sorting client-side in javascript. This works i guess but kinda defeats the purpose

Additional context

If this is a feature that would be appreciated I can start working on it.

Originally created by @jph-sw on GitHub (Jun 18, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like It would be very nice if you could sort by multiple fields in the `listUsers` function. Example: username -> role -> name This would really nice in a table 😁 ### Describe alternatives you've considered Manual sorting client-side in javascript. This works i guess but kinda defeats the purpose ### Additional context If this is a feature that would be appreciated I can start working on it.
GiteaMirror added the enhancement label 2026-03-13 08:35:39 -05:00
Author
Owner

@jph-sw commented on GitHub (Jun 18, 2025):

Something like:

sortyBy=["username", "role", "name"]

@jph-sw commented on GitHub (Jun 18, 2025): Something like: sortyBy=["username", "role", "name"]
Author
Owner

@dosubot[bot] commented on GitHub (Sep 17, 2025):

Hi, @jph-sw. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested enhancing the admin.listUsers function to support multi-field sorting via a sortBy parameter.
  • The goal is to enable sorting by multiple fields such as username, role, and name.
  • Currently, client-side sorting is used as a workaround but is not ideal.
  • You expressed willingness to contribute to implementing this feature.
  • No maintainer responses or further updates have been provided yet.

Next Steps:

  • Please let me know if this feature request is still relevant to the latest version of better-auth by commenting on this issue.
  • If I do not hear back within 7 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Sep 17, 2025): Hi, @jph-sw. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested enhancing the `admin.listUsers` function to support multi-field sorting via a `sortBy` parameter. - The goal is to enable sorting by multiple fields such as username, role, and name. - Currently, client-side sorting is used as a workaround but is not ideal. - You expressed willingness to contribute to implementing this feature. - No maintainer responses or further updates have been provided yet. **Next Steps:** - Please let me know if this feature request is still relevant to the latest version of better-auth by commenting on this issue. - If I do not hear back within 7 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1374