[starting from version: 2.8.17]
It is triggered when the Accelerator or the custom data source API server sends the 401 Unauthorized error in response to a Flexmonster's request. Only for "api"
and "microsoft analysis services"
data source types.
unauthorizederror
can be used to automatically refresh authorization headers and resend the request in case of the 401 Unauthorized
error:
flexmonster.on('unauthorizederror', function (callbackHandler) { // other actions // pass new request headers and resend the request callbackHandler({ requestHeaders: { AuthToken: "XXX" } }); });