AuthController
@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.
Type Parameters
Section titled “Type Parameters”USER extends User = any
ExtraData
Section titled “ExtraData”ExtraData = any
Properties
Section titled “Properties”authError?
Section titled “authError?”
optionalauthError:any
Defined in: types/auth.tsx:41
Error initializing the authentication
authLoading
Section titled “authLoading”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.
authProviderError?
Section titled “authProviderError?”
optionalauthProviderError:any
Defined in: types/auth.tsx:46
Error dispatched by the auth provider
extra:
ExtraData
Defined in: types/auth.tsx:58
getAuthToken()
Section titled “getAuthToken()”getAuthToken: () =>
Promise<string>
Defined in: types/auth.tsx:51
You can use this method to retrieve the auth token for the current user.
Returns
Section titled “Returns”Promise<string>
initialLoading?
Section titled “initialLoading?”
optionalinitialLoading: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
Section titled “loginSkipped”loginSkipped:
boolean
Defined in: types/auth.tsx:56
Has the user skipped the login process
setExtra()
Section titled “setExtra()”setExtra: (
extra) =>void
Defined in: types/auth.tsx:60
Parameters
Section titled “Parameters”ExtraData
Returns
Section titled “Returns”void
setUser()?
Section titled “setUser()?”
optionalsetUser: (user) =>void
Defined in: types/auth.tsx:62
Parameters
Section titled “Parameters”USER | null
Returns
Section titled “Returns”void
setUserRoles()?
Section titled “setUserRoles()?”
optionalsetUserRoles: (roles) =>void
Defined in: types/auth.tsx:64
Parameters
Section titled “Parameters”Role[]
Returns
Section titled “Returns”void
signOut()
Section titled “signOut()”signOut: () =>
Promise<void>
Defined in: types/auth.tsx:36
Sign out
Returns
Section titled “Returns”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