I wish this help you Take a look at the resolve parameter - this exists both in $routerProvider and $stateProvide. resolve resolves the objects (including resolving a promise) and then these objects are available to your controllers. In this case, you "resolve" your loggedInUser variable (by doing whatever you need to do via your authentication service.
this one helps. Node.js client SDK was not designed for this. It currently persists the session in memory. Once the user is signed in, you will have to issue your own token and return it to the client or set it in some cookie. You will then sign out that user. Future requests will check the cookie or the token you created. This is a simplistic answer as the sessions could be invalidated and you would lose that capability here. Ideally i would recommend using the client SDK on the browser or the app instead of doing it from a server.