<commit_before>// This is CLIENT SIDE ROUTES!
angular.module('appRoutes', [])

.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {

	    //================================================
	    // Check if the user is connected
	    //================================================
		var checkLoggedin = function($q, $timeout, $http, $location, $rootScope){
		    // Initialize a new promise
		    var deferred = $q.defer();

		    // Make an AJAX call to check if the user is logged in
		    $http.get('/loggedin').success(function(user){
		      // Authenticated
		    	if (user !== '0')
		        	$timeout(deferred.resolve, 0);
		        	// Not Authenticated
    		    else {
          			$rootScope.message = 'You need to log in.';
		          	$timeout(function(){deferred.reject();}, 0);
		          	$location.url('/login');
		        }
		    });

		    return deferred.promise;
		};
		//================================================

	$routeProvider

		// home page
		.when('/', {
			templateUrl: 'views/home.html',
			controller: 'MainController'
		})

		// auth protected: nerds page that will use the NerdController
		.when('/myswag', {
			templateUrl: 'views/myswag.html',
			controller: 'MySwagController',
			resolve: {
	          loggedin: checkLoggedin //defined in app.js
	        }
		})
		

		// 
		.when('/geeks', {
			templateUrl: 'views/geek.html',
			controller: 'GeekController'	
		})

		// Sign up form
		.when('/signup', {
			templateUrl: 'views/signup.html',
		})

		// Login form
		.when('/login', {
			templateUrl: 'views/login.html',
			controller: 'LoginController',
			flash: 'wha'
		});


	$locationProvider.html5Mode(true);

}]);<commit_msg>AngularJS URI routing is case sensitive :princess:<commit_after>// This is CLIENT SIDE ROUTES!
angular.module('appRoutes', [])

.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {

	    //================================================
	    // Check if the user is connected
	    //================================================
		var checkLoggedin = function($q, $timeout, $http, $location, $rootScope){
		    // Initialize a new promise
		    var deferred = $q.defer();

		    // Make an AJAX call to check if the user is logged in
		    $http.get('/loggedin').success(function(user){
		      // Authenticated
		    	if (user !== '0')
		        	$timeout(deferred.resolve, 0);
		        	// Not Authenticated
    		    else {
          			$rootScope.message = 'You need to log in.';
		          	$timeout(function(){deferred.reject();}, 0);
		          	$location.url('/login');
		        }
		    });

		    return deferred.promise;
		};
		//================================================

	$routeProvider

		// home page
		.when('/', {
			templateUrl: 'views/home.html',
			controller: 'MainController'
		})

		// auth protected page that will use the MySwagController
		.when('/myswag', {
			templateUrl: 'views/myswag.html',
			controller: 'MySwagController',
			caseInsensitiveMatch: true,
			resolve: {
	          loggedin: checkLoggedin //defined in app.js
	        }
		})
		

		// 
		.when('/geeks', {
			templateUrl: 'views/geek.html',
			controller: 'GeekController'	
		})

		// Sign up form
		.when('/signup', {
			templateUrl: 'views/signup.html',
		})

		// Login form
		.when('/login', {
			templateUrl: 'views/login.html',
			controller: 'LoginController',
			flash: 'wha'
		});


	$locationProvider.html5Mode(true);

}]);
{'fraction_non_alphanumeric': 0.2249786142001711, 'fraction_numerical': 0.0022811519817507843, 'mean_word_length': 2.696522655426765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3357322', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1018, 'n_words': 233}