Skip to main content

Interface: AuthContextValue

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

Combined auth context value.

Extends​

Properties​

error​

error: null | string

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

Error message if authentication failed

Inherited from​

AuthState.error


getAccessToken()​

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

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

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:103

Whether the user is authenticated

Inherited from​

AuthState.isAuthenticated


isLoading​

isLoading: boolean

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

Whether auth state is being loaded/verified

Inherited from​

AuthState.isLoading


login()​

login: (options) => Promise<void>

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

Initiate login flow

Parameters​

options​

LoginOptions

Returns​

Promise<void>

Inherited from​

AuthActions.login


logout()​

logout: () => Promise<void>

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

Log out and clear session

Returns​

Promise<void>

Inherited from​

AuthActions.logout


refresh()​

refresh: () => Promise<void>

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

Refresh the access token

Returns​

Promise<void>

Inherited from​

AuthActions.refresh


session​

session: null | AuthSession

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

Session tokens (null if not authenticated)

Inherited from​

AuthState.session


user​

user: null | ChiveUser

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

Authenticated user (null if not authenticated)

Inherited from​

AuthState.user