Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR basically just moves all Azure auth integration into the
$msal
plugin, and makes it not client-only.The problem with
useMSAL
being an async composable is that it made everything downstream async, which causes utter chaos when it comes to loading things, as now it's all happening multiple times and potentially 'in parallel'.I think I had originally tried to make
useMSAL
a composable so that we'd only try to load auth on pages that needed it, but things like the NavBar mean we always need that anyway, so the next logical step is to realize that it should just be a plugin, and happen before we do anything else. But since we use auth stuff everywhere, it can't just be a client-side plugin, it needs to run on the server to, and just fail if we try to do auth things during SSR (much likeuseMSAL
did before anyway)This should fix the problems I was seeing, which were manifesting as issues in
FakeUsers
andStandardNav
because they call a few composables that are kinda at different levels of the dependency hierarchy.Diagram:
The downside of this approach is mainly that
plugins/msal.ts
is now monstrously large, but all the auth stuff is now contained in one file, which will make it easy to backport to OPGEE.