Skip to main content
Version: 3.0.0-beta

Type Alias: AuthController<UserType, ExtraData>

AuthController<UserType, 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​

• UserType 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

roles?​

optional roles: Role[]

Roles related to the logged user

setExtra()​

setExtra: (extra) => void

Parameters​

• extra: ExtraData

Returns​

void

signOut()​

signOut: () => Promise<void>

Sign out

Returns​

Promise<void>

user​

user: UserType | 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!