I am bootstrapping Aurelia from a Web-forms based legacy application. My authentication related information is maintained in the web-forms application in the Custom Base Page class.
How do I pass & maintain this authentication information to Aurelia's global scope? So that I can use it while building the menus using routes to show/hide certain menu items based on the user/role?
You could put logic your custom base page to add a
<script>
tag to the head of the document that makes all the information available to javascript applications:Then in your aurelia app you can access this info as needed:
You could even register the object in the container, enabling you to declare it as a dependency. This will make your code more portable and testable.
In main.js:
aurelia.container.registerInstance('app-info', window.appInfo);