T
TanStack8mo ago
rare-sapphire

Router with azure msal-browser & msal-react

Does anyone have an example with tanstack/router integrated with microsoft's msal for authentication? I have an app built with react router, and when I try use the same msal config and setup, I get an error
uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API. For more visit: aka.ms/msaljs/browser-errors
uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API. For more visit: aka.ms/msaljs/browser-errors
However the MsalProvider component does the initialization on my other project, so trying to wrap my head around that one, in case it would be a bad idea if both call initialize. Thanks for any pointers in the right direction.
2 Replies
protestant-coral
protestant-coral6mo ago
Hello, did you fix the problem? Also could you share how you did the whole integration TTR with Azure MSAL? I have a similar case and I wonder how you managed to fix it
foreign-sapphire
foreign-sapphire6mo ago
@writes_of_spring - From previous experiences, I've typically seen this error when the MSAL lib tramples local storage/cookies. Try in an incognito window, or clear browser storage.

Did you find this page helpful?