I'm guessing this is more of an issue with my understanding of how the AssetManager works, but here is my problem:
I am using the grapejs-preset-webpage plugin. I have images that need to be retrieved with a custom authentication header. After initializing grapejs with assetManager config to add headers,
`const editor = grapesjs.init({
...
assetManager: {
headers: {'foo': 'bar'}
},
...
});`
I try to add my protected images like so:
var assetManager = editor.AssetManager; assetManager.add('https://cdn.pixabay.com/photo/2017/08/24/11/04/brain-2676370_960_720.jpg')
When I try to add an image block, I expect to see the request go through with my custom header, but it is not getting added. When i add an image via a link through the Asset Manager modal, I also don't see the headers being added. What am I missing or doing wrong?
I'm guessing this is more of an issue with my understanding of how the AssetManager works, but here is my problem:
I am using the grapejs-preset-webpage plugin. I have images that need to be retrieved with a custom authentication header. After initializing grapejs with assetManager config to add headers, `const editor = grapesjs.init({ ... assetManager: { headers: {'foo': 'bar'} }, ...
});`
I try to add my protected images like so:
var assetManager = editor.AssetManager; assetManager.add('https://cdn.pixabay.com/photo/2017/08/24/11/04/brain-2676370_960_720.jpg')
When I try to add an image block, I expect to see the request go through with my custom header, but it is not getting added. When i add an image via a link through the Asset Manager modal, I also don't see the headers being added. What am I missing or doing wrong?
Here's a codepen with my basic setup: https://codepen.io/jwalton922/pen/mdLrddL