Skip to main content

Function: useCurrentUser()

useCurrentUser(): object

Defined in: packages/api-client/src/use-auth.ts:19

The signed-in user, or null when unauthenticated (the API answers /api/auth/me with 401). isPending is true only on the first load, so the shell can show a splash instead of flashing the login screen.

Returns

object

isError

isError: boolean = query.isError

isLoading

isLoading: boolean = query.isPending

user

user: NonNullable<NoInfer<{ email: string; id: string; isAdmin: boolean; name: string | null; } | null>> | null