title: Unable to access code after returned object in Angular
body: <p>I'm having some trouble authenticating with a factory in my app. The goal is to get a token only if the user has not already been authenticated. When I use the code below, I get the following error:</p>
  
  <blockquote>
    <p>Cannot read property 'uid' of null</p>
  </blockquote>
  
  <p>I can't tell if this is just a minor syntax issue or something bigger. It looks like none of the code starting with <code>var authData</code> is being read. </p>
  
  <pre><code>(function() {
    'use strict';
     angular.module('firebase.auth', ['firebase', 'firebase.ref'])
  
     .factory('Auth', ['$firebaseAuth', 'Ref', function ($firebaseAuth, Ref) {
  
          return $firebaseAuth(Ref);
          var authData = Ref.getAuth();
          console.log(authData);
  
           if (authData) {
              console.log('already logged in with ' + authData.uid);
            } else {
  
              return Auth.$authAnonymously({rememberMe: true}).then(showError);
  
               function showError(err) {
                Login.err = err;
              }
            }
          }
      ]);
  })();
  
  angular.module('App')
  
     .factory('Projects', function ($firebaseArray, fbURL, Auth, Ref) {
          var authData = Ref.getAuth();
          var ref = new Firebase(fbURL + '/projects/' + authData.uid);
            return $firebaseArray(ref);
  })
  </code></pre>