I'm using meteor with React Router, meteor-webpack and meteor-useraccounts.
I want to redirect my user after a successfully logged in.
From the user accounts doc :
var mySubmitFunc = function(error, state){
if (!error) {
if (state === "signIn") {
// Successfully logged in
// ...
}
if (state === "signUp") {
// Successfully registered
// ...
}
}
};
AccountsTemplates.configure({
onSubmitHook: mySubmitFunc
});
Because AccountsTemplates configuration should be called in top-level code, this code has to be in meteor.startup.js when you are using meteor-webpack.
I wish call browserHistory.push('/some/path') in the "Successfully logged in" state but I have no access to my react router at this level.
What are my possibilities ?
Inside startup client folder I have file routes.js like this.