【发布时间】:2015-11-22 08:02:00
【问题描述】:
我正在尝试使用以下代码进行登录重定向:
Router.onBeforeAction(function () {
if (!Meteor.user() && !Meteor.loggingIn()) {
this.next();
} else {
// required by Iron to process the route handler
this.redirect('/map');
this.next();
}
});
但是,当我登录并成功将我重定向到 /maps 时,我无法单击导航栏上的任何链接。该链接工作正常,但是,当我单击它们时,它只会将我重定向回 /map。
我们将不胜感激!
另外,这里是github链接:
【问题讨论】:
-
我可能弄错了,但我觉得每次加载页面时您的代码总是在运行,因此如果您已登录,您会被重定向到 /map。
-
是的,这就是我现在的想法。问题只是如何解决它。
标签: redirect meteor iron-router meteor-accounts