0

In iron-router I use this before hook to check if logged in:

requireLogin: function(pause) {
    if (! Meteor.user()) {
      if (Meteor.loggingIn())
        this.render(this.loadingTemplate);
      else
        this.render('accessDenied');
      pause();
}

The problem is that I want to switch the layoutTemplate if they are not logged in. I'm using a login drop-down by the way. Advice?

sys13
  • 148
  • 9

2 Answers2

1

To switch to another layout template, I believe you can do:

this.layout('yourLayoutTemplate');
Bjørn Bråthen
  • 410
  • 8
  • 20
0

You can also try this.setLayout, as stated in this discussion: Redirecting not logged-in users with iron-router... Again

Community
  • 1
  • 1
steph643
  • 2,343
  • 1
  • 23
  • 20