auth-js icon indicating copy to clipboard operation
auth-js copied to clipboard

feat: add filter support to listUsers

Open 0x62 opened this issue 1 year ago • 1 comments

What kind of change does this PR introduce?

There is already support for a filter=xyz query param for the listUsers endpoint, but it is not exposed on the client. This PR adds support for the filter, which allows users to filter the respond of listUsers by a partial or full email address.

This PR also fixes pagination metadata for page values >9. This was originally proposed in #793, but changes were requested and that PR is now stale so I have implemented those changes here too.

What is the current behavior?

It is not possible to filter users via the SDK.

What is the new behavior?

You can now filter users.

Additional context

https://github.com/supabase/gotrue/issues/880

0x62 avatar Mar 18 '24 14:03 0x62

@kangmingtay any chance you could review this?

I came from https://github.com/supabase/auth/pull/1330#issuecomment-1848007008, but discovered there is no way to actually use this endpoint from the SDK

hi @JKFSOM, thanks for taking the time to contribute but i don't think we'll be adding this endpoint in - the GET /admin/users endpoint actually allows you to filter for a user's email address already:

for example:

curl -X GET "http://localhost:9999/admin/users?filter=<user_email_address>" -H "Authorization: Bearer ADMIN_JWT"

0x62 avatar Apr 24 '24 13:04 0x62