I have a React app which uses MSAL msal-react v1.3.1. I am using loginRedirect
method to redirect a predefined user flow configured in Azure B2C for password reset. The current behaviour is that when the password reset is complete it redirects back to the page that first invoked the redirect to AD B2C once it has completed successfully.
Is there a way to change the redirect url when the flow has completed to something like below?
instance.loginRedirect({
authority: `${config.authentication.authority}/${config.authentication.flow.register}`,
redirectUri: window.location.href + '?success=true'
});
I have tried to set the redirectUri
and postLoginRedirectUri
which don't appear to change the outcome.
What I had to do in this situation was set the navigateToLoginRequestUrl to false where you set up your msal. Example of someone's code with the navigateToLoginRequestUrl option: https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/3818
Then maybe you could use the state option to pass any information you want to the return URL instead of a query parameter on returnURL. But I don't quite see the point here.