title: Angularfire2: Proper approach to check if user is logged in?
body: <p>I wan't to allow only logged in users to access a certain site.
  What's the proper way of checking if a user is logged in on load?</p>
  
  <p>The code below is my first try, don't really know if it works though.
  Of course I already wrote db rules, now I want to complete the behavior visually for the user.</p>
  
  <pre class="lang-ts prettyprint-override"><code>this.af.auth.subscribe(auth =&gt; {
     if (auth) {
        //route to other view
     } else {
        //do whatever
     }
  });
  </code></pre>