function run($rootScope, $location, authentication) {
        $rootScope.$on('$routeChangeStart', function(event, nextRoute, currentRoute) {
            if ($location.path() === '/profile' && !authentication.isLoggedIn()) {
                $location.path('/');
            }
        });
    }
//TODO: update this to handle other things non logged in people shouldn't see
update this to handle other things non logged in people shouldn't see
update this to handle other things non logged in people shouldn ' t see
function run($rootScope, $location, authentication) {
        $rootScope.$on('$routeChangeStart', function(event, nextRoute, currentRoute) {
            if ($location.path() === '/profile' && !authentication.isLoggedIn()) {
                $location.path('/');
            }
        });
    }
function run ( $rootScope , $location , authentication ) { $rootScope . $on ( '$routeChangeStart' , function ( event , nextRoute , currentRoute ) { if ( $location . path ( ) === '/profile' && ! authentication . isLoggedIn ( ) ) { $location . path ( '/' ) ; } } ) ; }
TODO: update this to handle other things non logged in people shouldn't see
TODO : update this to handle other things non logged in people shouldn ' t see