tomitrescak/BulletProofMeteor

Update iron router method

Opened this issue · 0 comments

A small tweak, in router.js is needed to reflect changes in the iron router hooks:

( remove the pause argument/callback and add this.next() )

var requireLogin = function() {
    if (!Meteor.userId()) {
        if (Meteor.loggingIn()) {
            this.render(this.loadingTemplate);
        }
        else {
            this.render('introduction');
        }
        //pause();

    }
    this.next();
}

var requireAdmin = function() {
    if (!Meteor.user() && Roles.userIsInRole(Meteor.userId(), ['admin'])) {
        if (Meteor.loggingIn()){
            this.render(this.loadingTemplate);
        }
        else {
            this.render('introduction');
        }
        //pause();

    }
    this.next();
}

Thanks for the tutorial! Great help to starting out with Meteor!