Skip to content

Instantly share code, notes, and snippets.

@jankuca
Created July 15, 2012 10:55
Show Gist options
  • Save jankuca/3116253 to your computer and use it in GitHub Desktop.
Save jankuca/3116253 to your computer and use it in GitHub Desktop.
init: function (done) {
// 1
if (this.$session['user_id'] == null) {
return this.redirectTo('backend:sign:login');
}
// 2
this.$users.one(this.$session['user_id'], function (err, user) {
// 4
if (!err) {
this.current_user = user;
}
// 5
log(this.current_user['username']); // ok
// 6
done();
}, this);
// 3
log(this.current_user['username']); // undefined
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment