Open raduchiriac opened 8 years ago
I've managed to do this little "cleanup" before configuring my own route. Quite ugly IMO
delete AccountsTemplates.routes.signIn;
the thing is that the first call to configureRoute
actually set the route using the router API...
so, in principle, you should also cancel route configuration on the router: are you getting any problem with your current solution?
Nope. Deleting the key on that object gives you the option to "overwrite" an already set route. I'm not sure if you can close this. Let's just say, I found a hack not a solution. Thanks for a great package anyway!
In case we're sure it's not a problem to configure the same route twice with flow-router, we can avoid checking whether the route is already set up (i.e. we could remove these lines).
@arunoda, do you think it would be a problem doing something like the following?
FlowRouter.route('/one/path', {
name: 'myRoute',
// Other options here...
});
FlowRouter.route('/another/path', {
name: 'myRoute', // same name as above!
// Other different options here...
});
which is trying to change options (including path...) for a named route already defined.
It won't be an issue for the route name. But configuring the same route definition twice will be problematic.
@arunoda is there any way to undo or cancel a route definition so that a new call to FlowRouter.route
could then be safely performed?
Edit: alternatively, is there any way to change the options for an already defined route?
Thanks for the hack @raduchiriac, I ran into the same thing with telescope. Im interested to know if theres a superior solution.
Any updates on this? @raduchiriac 's hack did not work for me when trying to set a different layout for the '/sign-in'
route.
I have the same issue, can't set a different layout to the signIn route. Any updates please? @raduchiriac
@raduchiriac have you found any solution for this issue? If you have found any , pls share with us. i also need to set different layout for signUp in the AccountTemplates.
It's not a solution but a work-around. It's more than a year ago so I don't remember everything but checking my answer above, I think I was doing this:
delete AccountsTemplates.routes.signUp;
AccountsTemplates.configureRoute('signUp', {
name: 'signUp',
path: '/sign-up',
template: 'register'
});
I am using a TelescopeApp (v0.25.5) and I need to edit the route paths and templates for "sign-in" and "sign-up". These are already declared under
/telescope-users/lib/config.js
When I do:
I get an error saying:
Route already configured!
Is there a way I can override a previously (from the packages) declared route?