Hi @Akhil Kondepudi • Thank you for reaching out.
Assuming you are using MSAL.js, it provides 3 login APIs: loginPopup()
, loginRedirect()
, and ssoSilent()
. To use the redirect flow, you must register a handler for redirect promise. MSAL.js provides handleRedirectPromise() API. When you choose to use the redirect APIs, be aware that you MUST call handleRedirectPromise() to correctly handle the API.
myMSALObj.handleRedirectPromise()
.then((response) => {
// your logic
})
.catch(err => {
console.error(err);
});
myMSALObj.loginRedirect(loginRequest);
Note: It is not recommended to use both interaction types - pop-up and redirect, in a single application.
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.