Skip to content

AuthController

@firecms/core


@firecms/core / AuthController

Type Alias: AuthController<USER, ExtraData>

Section titled “Type Alias: AuthController<USER, ExtraData>”

AuthController<USER, ExtraData> = object

Defined in: types/auth.tsx:12

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.

USER extends User = any

ExtraData = any

optional authError: any

Defined in: types/auth.tsx:41

Error initializing the authentication


authLoading: boolean

Defined in: types/auth.tsx:31

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


optional authProviderError: any

Defined in: types/auth.tsx:46

Error dispatched by the auth provider


extra: ExtraData

Defined in: types/auth.tsx:58


getAuthToken: () => Promise<string>

Defined in: types/auth.tsx:51

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

Promise<string>


optional initialLoading: boolean

Defined in: types/auth.tsx:25

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

Defined in: types/auth.tsx:56

Has the user skipped the login process


setExtra: (extra) => void

Defined in: types/auth.tsx:60

ExtraData

void


optional setUser: (user) => void

Defined in: types/auth.tsx:62

USER | null

void


optional setUserRoles: (roles) => void

Defined in: types/auth.tsx:64

Role[]

void


signOut: () => Promise<void>

Defined in: types/auth.tsx:36

Sign out

Promise<void>


user: USER | null

Defined in: types/auth.tsx:18

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