3cb28cdecb
* Return both user and privateUser from `createuser` * Make `useStateCheckEquality` more flexible * Make `AuthContext` track the private user doc * Change `usePrivateUser` hook to use the auth context data * Pass both user and private user through SSR to auth context * Fix bug in create user flow
8 lines
209 B
TypeScript
8 lines
209 B
TypeScript
import { isAdmin } from 'common/envs/constants'
|
|
import { usePrivateUser } from './use-user'
|
|
|
|
export const useAdmin = () => {
|
|
const privateUser = usePrivateUser()
|
|
return isAdmin(privateUser?.email || '')
|
|
}
|