marmelab / ra-auth-msal

An auth provider for react-admin which handles authentication using the MSAL
MIT License
4 stars 2 forks source link

Query: How can I set the default route after login? #13

Closed simonfanz closed 1 month ago

simonfanz commented 1 month ago

When using msalAuthProvider what is the best way to set the default route after login?

slax57 commented 1 month ago

ra-auth-msal has deep linking enabled by default, which means the user will be redirected to the URL they originally requested.

If you disable this feature, the user will be redirected to window.location.origin.

If you would like to set a default redirect route, you will need to override the handleCallback method in the authProvider.

This could be a feature though, so feel free to open a PR to add this feature (i.e. add a parameter to set a default redirect route).

Since I answered I'll close this issue, but if you'd like to work on the feature let me know, I'll reopen it and mark it as enhancement request so you can reference it in your PR.

Thanks.