iron-meteor / iron-router

A client and server side router designed specifically for Meteor.
MIT License
1.98k stars 413 forks source link

Redirected to login after upgrade to 1.3.4 #1541

Open Batistleman opened 8 years ago

Batistleman commented 8 years ago

Anyone else having trouble after a meteor upgrade from 1.3.2 to 1.3.4?

I have the following code to redirect to the login page:

Router.onBeforeAction(function () {
    if (!(Meteor.loggingIn() || Meteor.user())) {
        console.log(Meteor);
        this.redirect('/login');
    }
    else {
        this.next();
    }
}

However, each new page I open redirects me to the login page.

romain-neil commented 7 years ago

I think you need to use Router.go('pageNamed') instead of this.redirect