Created
July 15, 2012 10:55
-
-
Save jankuca/3116253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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