Skip to main content

Interface: AuthContextValue

Defined in: web/lib/auth/types.ts:133

Combined auth context value.

Extends

Properties

error

error: null | string

Defined in: web/lib/auth/types.ts:96

Error message if authentication failed

Inherited from

AuthState.error


getAccessToken()

getAccessToken: () => Promise<null | string>

Defined in: web/lib/auth/types.ts:127

Get current access token (refreshes if needed)

Returns

Promise<null | string>

Inherited from

AuthActions.getAccessToken


isAuthenticated

isAuthenticated: boolean

Defined in: web/lib/auth/types.ts:84

Whether the user is authenticated

Inherited from

AuthState.isAuthenticated


isLoading

isLoading: boolean

Defined in: web/lib/auth/types.ts:87

Whether auth state is being loaded/verified

Inherited from

AuthState.isLoading


login()

login: (options) => Promise<void>

Defined in: web/lib/auth/types.ts:118

Initiate login flow

Parameters

options

LoginOptions

Returns

Promise<void>

Inherited from

AuthActions.login


logout()

logout: () => Promise<void>

Defined in: web/lib/auth/types.ts:121

Log out and clear session

Returns

Promise<void>

Inherited from

AuthActions.logout


refresh()

refresh: () => Promise<void>

Defined in: web/lib/auth/types.ts:124

Refresh the access token

Returns

Promise<void>

Inherited from

AuthActions.refresh


session

session: null | AuthSession

Defined in: web/lib/auth/types.ts:93

Session tokens (null if not authenticated)

Inherited from

AuthState.session


user

user: null | ChiveUser

Defined in: web/lib/auth/types.ts:90

Authenticated user (null if not authenticated)

Inherited from

AuthState.user