Type alias: AuthController<UserType>
Ƭ AuthController<UserType
>: 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. Check useFirebaseAuthController code for an example.
Type parameters
Name | Type |
---|---|
UserType | extends User = User |
Type declaration
Name | Type | Description |
---|---|---|
authError? | any | Error initializing the authentication |
authLoading | boolean | If you have defined an Authenticator, this flag will be set to true while it loads |
authProviderError? | any | Error dispatched by the auth provider |
extra? | any | Utility field you can use to store your custom data. e.g: Additional user data fetched from a Firestore document, or custom claims |
getAuthToken | () => Promise <string > | You can use this method to retrieve the auth token for the current user. |
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 | boolean | Has the user skipped the login process |
setExtra | (extra : any ) => void | You can use this method to store any extra data you would like to associate your user to. e.g: Additional user data fetched from a Firestore document, or custom claims |
signOut | () => void | Sign out |
user | UserType | null | The user currently logged in The values can be: the user object, null if they skipped login |