We are using flexmonster inside angular application to connect to mongodb connector. For authentication client provides Authorization Bearer in header of request, but the problem is that this Authorization header is not sent when flexmonster mode is changing - apply button on options dialog will not send request headers:
This is how we include flexmonster in demo app:
<script type="text/javascript">
var pivot = new Flexmonster({
container: "#pivot",
componentFolder: "https://cdn.flexmonster.com/",
height: 600,
toolbar: true,
report: {
"dataSource": {
"type": "api",
"url": "http://localhost:9204/mongo",
"index": "characteristic_history",
"requestHeaders": {
'Authorization': 'Bearer TEST_TOKEN_WHICH_IS_NOT_SENT_IN_FLAT_MODE'
},
}
},
licenseKey: "Z7EI-XB9J6V-07676E-0E1B2A"
});
</script>
Looks like when report has been changed via options dialog - compact to flat and vise versa - Authorization headers are lost.
What should we do that we get Authorization Bearer to be sent in flet-form mode to server?
We found this thread which answers our question:
https://www.flexmonster.com/question/using-http-interceptor-in-angular/
Hi Aleksandar,
Thank you for writing to us.
This is a known issue when working in flat view with custom data source API. We are currently working on a fix and it is going to be available with our next minor release ETA May 4th.
Please let us know if you have any other questions we can assist you with.
Best regards,
Mykhailo
Hi Aleksandar,
We are happy to let you know that the issue with requestHeaders
in custom data API was fixed. This is available in the 2.8.6 version of Flexmonster: https://www.flexmonster.com/release-notes/
You are welcome to update the component. Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/
Please contact us in case any questions arise.
Best regards,
Mykhailo
We will try it. Thank you for fast response!