-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Labels
bugneeds team reproWe acknowledged your report and will soon try to reproduce itWe acknowledged your report and will soon try to reproduce itpriority: nowscope: cli-service buildwork-in-progress
Description
Version
3.0.0-rc.3
Reproduction link
https://1656-repro-jdyuryvihq.now.sh/
username: john
pwd: secret
Steps to reproduce
(No repro)
Build an app with vue-cli, and deploy the SPA under an HTTP Basic Authentification.
What is expected?
Assets are loaded from same-origin with credentials
What is actually happening?
JS modules assets (with type="module") are not forwarding credentials properly and fail to load with a 401 response from the server.
As stated in https://jakearchibald.com/2017/es-modules-in-browsers/ (No credentials section)
<!-- Fetched with credentials (cookies etc) -->
<script src="1.js"></script>
<!-- Fetched without credentials -->
<script type="module" src="1.mjs"></script>
<!-- Fetched with credentials -->
<script type="module" crossorigin src="1.mjs?"></script>
<!-- Fetched without credentials -->
<script type="module" crossorigin src="https://other-origin/1.mjs"></script>
<!-- Fetched with credentials-->
<script type="module" crossorigin="use-credentials" src="https://other-origin/1.mjs?"></script>
We then have to modify the ModernModePlugin https://github.com/vuejs/vue-cli/blob/0b42f2f77a89602dfcfa54d3bbf57f7bdd31420a/packages/%40vue/cli-service/lib/webpack/ModernModePlugin.js
to include crossorigin attribute, or give the ability to add it via vue.config.js
Metadata
Metadata
Assignees
Labels
bugneeds team reproWe acknowledged your report and will soon try to reproduce itWe acknowledged your report and will soon try to reproduce itpriority: nowscope: cli-service buildwork-in-progress