Meteor服务器登录后未重定向

Meteor服务器登录后未重定向,meteor,user-accounts,Meteor,User Accounts,我试图让Meteor在登录后总是重定向到用户的仪表板。出于某种原因,这是行不通的。有什么想法吗 Accounts.onLogin(function() { return Router.render('/dashboard'); }); 所以我试图在一个带有onLogin函数的Accounts文档中实现这一点。它在router.js文档中很容易处理,如下所示: var goToDashboard = function(pause) { if (Meteor.user()) {

我试图让Meteor在登录后总是重定向到用户的仪表板。出于某种原因,这是行不通的。有什么想法吗

Accounts.onLogin(function() {
  return    Router.render('/dashboard');
});

所以我试图在一个带有onLogin函数的Accounts文档中实现这一点。它在router.js文档中很容易处理,如下所示:

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

Router.onBeforeAction(goToDashboard, {except: ['signin']});
可能重复的