<commit_before>
(function () {
	'use strict'; 

	angular.module('ppl', ['ngRoute', 'ngCookies'])
	.config(['$locationProvider', '$routeProvider', function ($locationProvider, $routeProvider) {
		$locationProvider.html5Mode(true);
		$routeProvider
		.when('/', {
		    templateUrl: '../workout.html',
		    controller: 'workoutController'
		})
		.when('/auth/facebook/callback', {
			templateUrl: '../workout.html',
		    controller: 'workoutController'
		})
		.when('/routines', {
		    templateUrl: '../routines.html',
		    controller: 'routineController'
		})
		.when('/login', {
		    templateUrl: '../login.html',
		    controller: 'loginController'
		});
	}])
	.run(['$rootScope', '$cookies', '$location', 'dataService', function ($rootScope, $cookies, $location, dataService) {
		if(!$cookies.get('connect.sid')) {
			$rootScope.loggedIn = false;
			$rootScope.menu = false;
			$location.path('/login');
		}
		else if (!$rootScope.user){
			$rootScope.loggedIn = true;
			$rootScope.loading = true;
			dataService.userInfo(window.localStorage.getItem("userID"))
			.then(function (payload) {
				$rootScope.user = payload.data;
				$rootScope.loading = false;
			});
		}
	}])
	.service('dataService', function($q, $http){
		return {
			login : function(body) {
				return $http({
					url:'/login',
					method: "POST",
					data: body
				});
			},

			loginFB : function(body) {
				return $http({
					url:'/auth/facebook/login',
					method: "GET"
				});
			},

			routines : function() {
				return $http({
					url:'/routines',
					method: "GET"
				});
			},

			userInfo : function(id) {
				return $http({
					url:'/user/id/' + id,
					method: "GET"
				});
			}
		};
	})
	.controller('loginController', function($scope, dataService, $cookies, $location, $rootScope, $sce) {
		$rootScope.loggedIn = false;
		if($cookies.get('connect.sid')) {
			$rootScope.loggedIn = true;
			$location.path('/');
		}
		$scope.submit = function() {
			var body = 
			{
				email: $scope.user,
				password: $<PASSWORD>
			}
			dataService.login(body)
			.then(function (payload) {
				$rootScope.user = angular.copy(payload.data);
				$rootScope.loggedIn = true;
				window.localStorage.setItem("userID", payload.data._id);
				$location.path('/');
			});
		}
		$scope.submitFB = function() {

			dataService.loginFB()<commit_msg>fix paths to users and routines<commit_after>
(function () {
	'use strict'; 

	angular.module('ppl', ['ngRoute', 'ngCookies'])
	.config(['$locationProvider', '$routeProvider', function ($locationProvider, $routeProvider) {
		$locationProvider.html5Mode(true);
		$routeProvider
		.when('/', {
		    templateUrl: '../workout.html',
		    controller: 'workoutController'
		})
		.when('/auth/facebook/callback', {
			templateUrl: '../workout.html',
		    controller: 'workoutController'
		})
		.when('/routines', {
		    templateUrl: '../routines.html',
		    controller: 'routineController'
		})
		.when('/login', {
		    templateUrl: '../login.html',
		    controller: 'loginController'
		});
	}])
	.run(['$rootScope', '$cookies', '$location', 'dataService', function ($rootScope, $cookies, $location, dataService) {
		if(!$cookies.get('connect.sid')) {
			$rootScope.loggedIn = false;
			$rootScope.menu = false;
			$location.path('/login');
		}
		else if (!$rootScope.user){
			$rootScope.loggedIn = true;
			$rootScope.loading = true;
			dataService.userInfo(window.localStorage.getItem("userID"))
			.then(function (payload) {
				$rootScope.user = payload.data;
				$rootScope.loading = false;
			});
		}
	}])
	.service('dataService', function($q, $http){
		return {
			login : function(body) {
				return $http({
					url:'/login',
					method: "POST",
					data: body
				});
			},

			loginFB : function(body) {
				return $http({
					url:'/auth/facebook/login',
					method: "GET"
				});
			},

			routines : function() {
				return $http({
					url:'/api/routines',
					method: "GET"
				});
			},

			userInfo : function(id) {
				return $http({
					url:'/api/user/id/' + id,
					method: "GET"
				});
			}
		};
	})
	.controller('loginController', function($scope, dataService, $cookies, $location, $rootScope, $sce) {
		$rootScope.loggedIn = false;
		if($cookies.get('connect.sid')) {
			$rootScope.loggedIn = true;
			$location.path('/');
		}
		$scope.submit = function() {
			var body = 
			{
				email: $scope.user,
				password: $scope.<PASSWORD>
			}
			dataService.login(body)
			.then(function (payload) {
				$rootScope.user = angular.copy(payload.data);
				$rootScope.loggedIn = true;
				window.localStorage.setItem("userID", payload.data._id);
				$location.path('/');
			});
		}
		$scope.submitFB = function() {

			dataService.loginFB()
{'fraction_non_alphanumeric': 0.19050659855257557, 'fraction_numerical': 0.0004257130693912303, 'mean_word_length': 3.162090345438441, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1746550', 'n_tokens_mistral': 1946, 'n_tokens_neox': 1581, 'n_words': 268}