Skip to main content
Version: 3.0.0-beta

Type Alias: AuthController<USER, ExtraData>

AuthController<USER, ExtraData>: object

Controller for retrieving the logged user or performing auth related operations. Note that if you are implementing your AuthController, you probably will want to do it as the result of a hook.

Type Parameters​

• USER extends User = any

• ExtraData = any

Type declaration​

authError?​

optional authError: any

Error initializing the authentication

authLoading​

authLoading: boolean

Loading flag. It is used to display a loading screen when the user is logging in or out.

authProviderError?​

optional authProviderError: any

Error dispatched by the auth provider

extra​

extra: ExtraData

getAuthToken()​

getAuthToken: () => Promise<string>

You can use this method to retrieve the auth token for the current user.

Returns​

Promise<string>

initialLoading?​

optional initialLoading: boolean

Initial loading flag. It is used not to display the login screen when the app first loads, and it has not been checked whether the user is logged in or not.

loginSkipped​

loginSkipped: boolean

Has the user skipped the login process

setExtra()​

setExtra: (extra) => void

Parameters​

• extra: ExtraData

Returns​

void

setUser()?​

optional setUser: (user) => void

Parameters​

• user: USER | null

Returns​

void

setUserRoles()?​

optional setUserRoles: (roles) => void

Parameters​

• roles: Role[]

Returns​

void

signOut()​

signOut: () => Promise<void>

Sign out

Returns​

Promise<void>

user​

user: USER | null

The user currently logged in The values can be: the user object, null if they skipped login

Defined in​

packages/firecms_core/src/types/auth.tsx:12

Sign up to our newsletter to get the latest news and updates. No spam!