Tokens
When using the Storage Configurator in Anonymous mode π, you will need to handle the lifecycle of your Authentication Token π
For that purpose, you have two dedicated events: "TokenExpired" and "TokenRefreshed".
Event name | Input / Output | Payload | Reason |
---|---|---|---|
TokenExpired | Input event | None. | To get notify when the current authentication token has expired. |
TokenRefreshed | Output event | See the description below. | To send the new authentication token. |
Example
// Receive the project info.
configurator.addEventListener("tokenExpired", (event) => {
// Here your code to generate a new token
configurator.dispatchEvent(new CustomEvent("tokenRefreshed", { detail: newToken }))
});
Payload description
Attribute name | Type | Content |
---|---|---|
token | String | The new authentication token. |