Backbone router and Meteor user authentication -
i'm new meteor, , use backbone router in project:
approuter = backbone.router.extend ({ "routes": { "": "home", // ... }, "home": function() { if (meteor.user()) { // ... } else { // ... } } });
the problem have that, when user logged in , goes "home" page, meteor.user() returns null , meteor.loggingin() returns true...so guess need wait end of authentication, how can (meteor.loginwithpassword seems called automatically when loading page)?
assuming meteor calls kind of callback when login finishes, delay calling backbone.history.start()
until then.
Comments
Post a Comment