Description of the problem
We are using cookies to authenticate requests to a data store. GLTFLoader is used to load 3D models from this data store. We have been trying to set crossOrigin = 'use-credentials
or setCrossOrigin('use-credentials');
, however, cookies are not being sent to download the GLB/GLTF file.
From reviewing the code for GLTFLoader it appears that withCredentials is not being set on FileLoader when crossOrigin === ‘use-credentials’. See these lines:
three.js/examples/js/loaders/GLTFLoader.js
Lines 66 to 71
in
93e72ba
It appears that the solution is to check if crossOrigin === 'use-credentials
and call loader.setWithCredentials(true) around line 70.
Three.js version
- [] Dev
- r104
- r97
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Should be taken care of by this PR:
#16601