Skip to content
IC Reactor

UseAuthReturn

Defined in: react/src/hooks/createAuthHooks.ts:8

authenticate: () => Promise<Identity | undefined>

Defined in: react/src/hooks/createAuthHooks.ts:9

Promise<Identity | undefined>


login: (options?) => Promise<void>

Defined in: react/src/hooks/createAuthHooks.ts:10

AuthenticationSignInOptions

Promise<void>


logout: (options?) => Promise<void>

Defined in: react/src/hooks/createAuthHooks.ts:11

string

Promise<void>


isAuthenticated: boolean

Defined in: react/src/hooks/createAuthHooks.ts:12


isAuthenticating: boolean

Defined in: react/src/hooks/createAuthHooks.ts:20

true while a sign-in or sign-out is in progress, and until the session restore the first useAuth() starts has settled: on the first render, in a server render and while the stored session is read. A restore that fails settles it too. Show a loading state while it is true rather than treating isAuthenticated: false as signed out.


principal: Principal | null

Defined in: react/src/hooks/createAuthHooks.ts:26

The signed-in user’s principal, or null while signed out. A signed-out session still holds an anonymous identity, and its principal is not returned here.


identity: Identity | null

Defined in: react/src/hooks/createAuthHooks.ts:27


error: Error | undefined

Defined in: react/src/hooks/createAuthHooks.ts:28