 
 app = angular.module 'playlistApp'
 
-app.controller 'AuthCtrl', ['$scope', '$http', '$window', 'APIBase', ($scope, $http, $window, APIBase) ->
+app.controller 'AuthCtrl', ['$scope', '$http', '$window', '$interval', 'APIBase', ($scope, $http, $window, $interval, APIBase) ->
     $scope.getUsername = ->
         $http(
             method: 'GET'


    $scope.message = ""
    $scope.loggedIn = $scope.getUsername()
    $scope.getUsername()
    return
]
        ).success (data, status, headers, config) ->
            $scope.username = data.username
            $scope.loggedIn = true
            console.log("Successfully authenticated (for now...)")
            return
        .error (data, status, headers, config) ->
            $scope.logout()
            return

    ## Check to see if the user is logged in (every interval seconds)
    $interval ->
        $scope.getUsername()
        return
    ,6000

    $scope.login = (user) ->
        $http.post(
