Q:

Ember.js - this.set() in ApplicationRoute not working

I am trying to set a boolean variable whenever the user is logged in. 
App.ApplicationRoute = Ember.Route.extend({
  isLoggedIn: false,

  init: function() {
      if (loggedIn) {
        this.set('isLoggedIn', true);
      } else {
        console.log(error)
        this.set('isLoggedIn', false);
      }
    });
  }
});

However, on this.set() I get:

Uncaught TypeError: undefined is not a function  

Any ideas?
I figured that the best place to handle user session is in the App.ApplicationRoute since its the root of everything. Does this cause a problem?
UPDATED:
With feedback here is the current / full code. 
App.ApplicationRoute = Ember.Route.extend({
  isLoggedIn: false,

  init: function() {
    this._super();

    auth = new FirebaseSimpleLogin(appRef, function(error, user) {
      if (user) {
        console.log(user)
        this.set('isLoggedIn', true);
      } else {
        console.log(error)
        this.set('isLoggedIn', false);
      }
    });
  }
})

So I left out my Firebase code previously because I didnt really think it relevant, but for the sake of tracking down the problem, I'll add it in.

A:

The reason has to do with the 
this

being wrongly set in your firebasesimplelogin. The function you are using inside the constructor must be passed in a reference to 'this' of the outer context. The easiest way to do it is by changing the code of the function to this:
function(error, user) {
  if (user) {
    console.log(user)
    this.set('isLoggedIn', true);
  } else {
    console.log(error)
    this.set('isLoggedIn', false);
  }
}.bind(this));

