Closed aapoalas closed 6 years ago
You can use them within a <script>
whose crossorigin=""
attribute is set appropriately to give credentials. This applies to all imports, not just dynamic ones.
Ah, thank you for enlightening me! Now I feel way stupid :)
@domenic For my understanding, does that mean I can do:
<script type="module" src="foo.js" crossorigin=""></script>
// foo.js
import './bar.js';
import('./baz.js');
Then foo.js
, bar.js
and baz.js
should all be loaded with credentials?
Hello
Chrome has already rolled out dynamic ES6 imports. I have been wanting to try it out with a system where part of the UI data is fetched from a remote server / other localhosted server. Problem is that this data is, naturally, hidden behind an authentication layer and, as far as I understand, there is currently no way to send credentials with the dynamic import.
I readily admit myself to be woefully ignorant of the deeper implications of credentials inclusion in dynamic imports, but it does nevertheless seem to me like this feature will be of utmost importance to many use cases. Is there any road map with regards to authentication with dynamic imports?