Description
Is your feature request related to a problem? Please describe.
The logic for tracking authentication progress, success, and failure and dispatching Redux events to store the info into a Redux store has become very tightly coupled to the authentication logic itself. This is bad for the general complexity of the library and means there's lots of extra code that is not relevant to users who aren't utilizing Redux at all.
It's also true that you don't need the AzureAD
component to track these state changes. All the necessary callbacks are already exposed on the MSAL UserAgentApplication
class, so state management should be tied directly to the MSAL library.
Describe the solution you'd like
All Redux state management logic should be removed and placed into a separate library whose sole purpose is to track MSAL changes against a Redux store. The adapter plugin could automatically hook into the MSAL event callbacks and push relevant data into the Redux store.
This would allow the react-aad-msal
library to be much smaller and less complex and not rely on Redux as a dependency. It would also provide some more usefulness to anyone using MSAL with other wrapper libraries or even vanilla JS apps who also want to utilize Redux to track state.
Additional context
Ultimately, anyone wanting to use a third party state management system should create a separate adapter plugin that could closely match the Redux plugin described above. It could also be possible to develop a shared interface for building state management adapters against MSAL so that other state libraries (RxJs, MobX, etc) could easily be integrated.