Handling expired tokens

This page will explain how to handle expired tokens in a DIM context

When a token expires within our Drop-in Modules (DIM), We send an onError event and present a screen to inform this:

{
    "eventName": "EXPIRED_TOKEN",
    "message": "Looks like token is expired",
    "metadata": {
        "module": "loan-servicers-login"
    }
}

Here you have the option to skip the session expired screen and handle the experience at your end. To remove the session expired screen you need to pass {showTokenExpiredPage: 0} :

{
    module: 'loan-servicers-login',
    token,
    showTokenExpiredPage: 0
}

Moreover, you can also customize the given screen’s all details like title, subtitle, button text:

{
    module: 'loan-servicers-login',
    token,
    tokenExpiredPageTitle: 'Your session has expired.',
    tokenExpiredPageSubTitle: 'You’ve timed out due to inactivity. You may close and try again.',
    tokenExpiredPageExitBtnLabel: 'Close'
}

When the close button is clicked on the session expired screen, we send an onExit callback and close the DIM. This allows for the possibility of relaunching the DIM with a fresh token if necessary. This information is contained in the MetaData Schema.

{
    "eventName": "DROPIN_EXIT",
    "message": "Drop in Module Closed."
}

To learn more about our debt APIs and 1-click solutions, visit spinwheel.io.