Skip to content

AuthUser

AuthUser = object

Defined in: packages/auth/src/types.ts:10

The authenticated user object available throughout the application.

Contains identity fields, assigned roles, and optional impersonation state. This is the user shape returned by AuthContext and AuthenticatedContext, and is the same object passed to createDb({ user }) for permission resolution.

avatarUrl: string | null

Defined in: packages/auth/src/types.ts:18

URL to the user’s avatar image, or null if not set.


email: string

Defined in: packages/auth/src/types.ts:14

The user’s email address, used for magic link authentication.


id: string

Defined in: packages/auth/src/types.ts:12

Unique user identifier (UUID from Better Auth).


optional isImpersonating: boolean

Defined in: packages/auth/src/types.ts:22

Whether an admin is currently impersonating this user.


name: string

Defined in: packages/auth/src/types.ts:16

Display name for the user.


optional realUser: object

Defined in: packages/auth/src/types.ts:24

The real admin user performing the impersonation, if active.

id: string

name: string


roles: string[]

Defined in: packages/auth/src/types.ts:20

Roles assigned to this user, matching role names from @cfast/permissions.