Pregunta

I'm trying to make Meteor always redirect to a User's Dashboard after login. For some reason this isn't working. Any ideas?

Accounts.onLogin(function() {
  return    Router.render('/dashboard');
});
¿Fue útil?

Solución

So I was trying to do this in an Accounts document with the onLogin function. It was easily handled in the router.js document as follows:

var goToDashboard = function(pause) {
  if (Meteor.user()) {
    Router.go('dashboard');
    pause();
  }
};

Router.onBeforeAction(goToDashboard, {except: ['signin']});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top