r/Firebase • • 15d ago

Authentication A Firebase Function Kit that gives you a user admin panel

I've published a Firebase Function Kit (the replacement for extensions) that gives you, and whoever else you designate, a user administration control panel for your app. Basically it shows you a list of users from Firebase Authentication, or lets you look one up by email or UID, and then lets you do things like disable or delete the account, change their name or photo, and edit custom claims. There is a special custom claim that grants access to the admin panel.

Installation isn't quite as simple as "install the function kit" because you also have to be able to log in, but it's still pretty simple, especially if you're using Firebase Hosting. Basically you (1) install the kit with "firebase functions:kits:install", then (2) map a URL path to call one of the functions.

I have an unreleased version, not really ready for release, that has some more sophisticated features, like copying user metadata to a database for better search and sort, and additional ways to customize. I'm not likely to make it free and open source, but if you're interested in additional features and can support a bit of development work, let me know.

The kit is here: https://www.npmjs.com/package/@aldel/superusers

I think this might be the first third-party function kit released. The only other kit I've even seen is the official one for Firestore -> BigQuery.

1 Upvotes

2 comments sorted by

1

u/unicornshedsocial 15d ago

I'd check how the panel handles an admin losing their access claim while their existing ID token is still valid. Does each privileged request check current permissions or token revocation?

1

u/adelespinasse 15d ago

It checks the current permissions, by fetching the user from Firebase Auth instead of just checking the token sent with the request. There's a note about this at the bottom of the README, reminding developers that claims can persist in users' tokens for up to an hour.