text: myApp.controller('UserController', ['$scope', '$http', '$location', function($scope, $http, $location) {
    // This happens after view/controller loads -- not ideal but it works for now.
    console.log('checking user');
    $http.get('/user').then(function(response) {
        if(response.data.username) {
            // user has a curret session on the server
            $scope.userName = response.data.username;
            console.log('User Data: ', $scope.userName);
        } else {
            // user has no session, bounce them back to the login page
            $location.path("/home");
        }
    });
  
    $scope.logout = function() {
      $http.get('/user/logout').then(function(response) {
        console.log('logged out');
        $location.path("/home");
      });
    }
  }]);
  