deptagency/algomart

List users endpoint with filtering, pagination

Opened this issue · 4 comments

Add endpoint for listing Firebase users in the admin portion of the application. Needs to support pagination and filtering for the users table. This endpoint will exist in the front-end API, since this is where Firebase admin is used.

@dallashuggins for adding a user, how do we want to handle stuff that'd normally be input by the user? Eg password & passphrase? I'm thinking password could be the typical temporary->user-update workflow, but is passphrase a 1-time set?

@lefnire Aw right, great point. I totally forgot about this aspect, and remember now why pagination and filtering was important. It may actually make sense to search through users by email, and then assign/revoke permissions, vs creating the user where we they would have to share that sensitive information. The passphrase is only set once and cannot be reset yet, so that works much better. Sorry for the misleading comments! Remembering there is one complication there too, as Firebase Admin doesn't allow for easy filtering through the list of users, so we'll need to search based on the exact email or phone number.

To verify: no create-user feature here then (to avoid admin needing passphrase)?

as Firebase Admin doesn't allow for easy filtering through the list of users, so we'll need to search based on the exact email or phone number.

Username & email are stored in api/UserAccount as well, we could ILIKE. Not phone though, do we indeed want the search against Firebase users, not UserAccounts?

@lefnire Yeah, I think that makes the most sense. Oh great call! I hadn't thought about sorting through the users table actually, but there should always be a Firebase account associated, so that would work perfectly. 🙌