<commit_before>'use strict';

angular.module('users').controller('AuthenticationController', ['$scope', '$http', '$location', 'Authentication',
	function($scope, $http, $location, Authentication) {
		$scope.authentication = Authentication;

		//If user is signed in then redirect back home

		/*
			TODO : Make sure a user is a user when they fill out second page of signup.
		 	Currently, completing the first sign up page makes a user a saved user and the following
		 	'if' statement will automatically redirect the now-saved user to the homepage.
		*/

		//if ($scope.authentication.user) $location.path('/');

		$scope.signup = function() {
			$http.post('/auth/signup', $scope.credentials).success(function(response) {
				// If successful we assign the response to the global user model
				$scope.authentication.user = response;

				// And redirect to the index page
				$location.path('/signup2');
			}).error(function(response) {
				$scope.error = response.message;
			});
		};

		$scope.signin = function() {
			$http.post('/auth/signin', $scope.credentials).success(function(response) {
				// If successful we assign the response to the global user model
				$scope.authentication.user = response;

				// And redirect to the index page
				$location.path('/profilepage');
			}).error(function(response) {
				$scope.error = response.message;
			});
		};
	


	

}


]);<commit_msg>First signup page redirects to a second signup page<commit_after>'use strict';

angular.module('users').controller('AuthenticationController', ['$scope', '$http', '$location', 'Authentication',
	function($scope, $http, $location, Authentication) {
		$scope.authentication = Authentication;

		//If user is signed in then redirect back home

		/*
			TODO : Make sure a user is a user when they fill out second page of signup.
		 	Currently, completing the first sign up page makes a user a saved user and the following
		 	'if' statement will automatically redirect the now-saved user to the homepage.
		*/

		
		//if ($scope.authentication.user) $location.path('/');

		$scope.signup = function() {
			$http.post('/auth/signup', $scope.credentials).success(function(response) {
				// If successful we assign the response to the global user model
				$scope.authentication.user = response;

				// And redirect to the index page
				$location.path('/signup2');
			}).error(function(response) {
				$scope.error = response.message;
			});
		};

		$scope.signin = function() {
			$http.post('/auth/signin', $scope.credentials).success(function(response) {
				// If successful we assign the response to the global user model
				$scope.authentication.user = response;

				// And redirect to the index page
				$location.path('/profilepage');
			}).error(function(response) {
				$scope.error = response.message;
			});
		};
		
}


]);
{'fraction_non_alphanumeric': 0.13361611876988336, 'fraction_numerical': 0.0007069635913750442, 'mean_word_length': 3.6091205211726383, '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': '2144055', 'n_tokens_mistral': 925, 'n_tokens_neox': 778, 'n_words': 252}