Closed ghost closed 6 months ago
@yourikoeman, glad to hear that you are finding this project useful.
Regarding your issue, have you seen this recipe in the docs: https://nareshbhatia.github.io/mobx-state-router/docs/guides-recipes#redirecting-to-the-sign-in-page? Does it address your problem?
Of course, this means that you have to add the beforeEnter on every private route, but it gives the flexibility to have some public routes too. If I understand you correctly, with a global beforeEnter() you will loose the ability to mark some routes as public.
Removed
@yourikoeman, I see your point now. Please feel free to send a PR.
To confirm my understanding:
beforeEnter
hook.RouterStore
. Type will be TransitionHook
.globalBeforeEnter
, just so that people don't get confused with Route.beforeEnter
?Please keep changes to minimal necessary and make sure that all existing tests are running successfully.
Removed
Thanks @yourikoeman.
No special considerations regarding updating of tests and documentation - just an overall focus on quality. I will of course be reviewing to make sure everything is in order.
Removed
Removed