'Load Webpack Chunks from Azure Storage CDN only after authenticating with Auth0

I have done a fair amount of googling and haven't been able to find quite what I'm looking for- previously I have built a React application where the Webpack chunks generated via codesplitting have been uploaded to Azure Storage to function like a CDN, and that works great.

However, I am working on an application now where the person contracting me would like to have certain chunks require authentication. The site itself uses Auth0 for authentication, and I was curious if anyone has experience with this- utilizing Auth0 authentication to also authenticate against Azure storage to allow a Webpack chunk to load.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source