阻止 Iron-Router 在登录后自动重定向

Stop Iron-Router from automatically redirecting after login

我注意到,在登录后,我的登录包或 Iron-Router 本身会将您重定向到主页模板。我似乎找不到任何方法来禁用此行为。

我使用的可能相关的软件包:

我是这样处理登录的:

unless currentUser
  +login
else
  +yield

不要尝试在您的模板中处理它,而是直接在 iron-router 中使用您的路由中的 onBeforeAction 处理程序来处理它:

onBeforeAction: function(){
  if ( Meteor.userId() ){
    this.next();
  } else this.render('login');
},