0

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');
});
Chris
  • 594
  • 1
  • 10
  • 27
  • 1
    possible duplicate of [How to redirect after user has just logged in or just logged out](http://stackoverflow.com/questions/22900405/how-to-redirect-after-user-has-just-logged-in-or-just-logged-out) – David Weldon Apr 08 '14 at 20:04

1 Answers1

0

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']});
Chris
  • 594
  • 1
  • 10
  • 27