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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -