manifold/web/hooks/use-admin.ts
Austin Chen ebed7c15c0
Manifold for Teams: Support different Firestore dbs (#53)
* Add Firebase config for TheoremOne

* Fix build

* Check in Firebase indexes

* Whitelist admins and new users by email
2022-02-26 22:08:50 -08:00

9 lines
249 B
TypeScript

import { isAdmin } from '../../common/access'
import { usePrivateUser, useUser } from './use-user'
export const useAdmin = () => {
const user = useUser()
const privateUser = usePrivateUser(user?.id)
return isAdmin(privateUser?.email || '')
}