Credential states
Credentials go through various states during their lifecycle. Understanding these states is crucial for providing appropriate UI feedback to your users.
Each credential object has a state field:
...
state: {
index: 3, // Number from -2 to 7
max: 7, // Always 7
title: "2FA code is required", // Title of the current state
message: "A 2FA code has been sent to ***@gmail.com" // Instructions for the current state
},
...
| State | Index | Description | Possible actions |
|---|---|---|---|
| Unknown | 0 | Something went wrong - Unexpected state | Delete, Re-connect |
| Preparing collect | 1 | Initial preparation phase before collection starts | Delete, View collect |
| Login in progress | 2 | Authentication process is underway | Delete, View collect |
| 2FA code required | 3 | Two-factor authentication code is needed from user | Delete, View collect |
| Performing 2FA | 4 | Processing the provided 2FA code | Delete, View collect |
| Collecting data | 5 | Gathering data from the collector source | Delete, View collect |
| Downloading invoices | 6 | Retrieving invoice files | Delete, View collect |
| Done | 7 | Collection completed successfully | Delete |
| Error | -1 | An error occurred during the process | Delete |
| Disconnected | -2 | Credential needs to be reconnected | Delete, Re-connect |