How can I limit the serving of a javascript file to only authenticated users?
问题 I have a WebAPI 2 / AngularJS SPA application that uses Identity 2 for authentication. Locally my code stores a token for authentication. I would like to implement functionality that allows my application to request additional javascript for authenticated users after my initial index.html page has been downloaded. Is there a way I can make my server code give out the javascript files to only authenticated and authorized users? Something similar to the way a controller action method returns