<commit_before>'use strict';


angular.module('core').controller('HomeController', ['$scope', 'Authentication',
	function($scope, Authentication) {
		// This provides Authentication context.
		$scope.authentication = Authentication;
	}
]);<commit_msg>Added redirect via  if user is already logged in<commit_after>'use strict';


angular.module('core').controller('HomeController', ['$scope', '$location','Authentication',
  function($scope, $location, Authentication) {
    // This provides Authentication context.
    $scope.authentication = Authentication;

    //this function ensures redirect to /user-to-do after login
    $scope.$watch(function(){return $location.path();}, function(next,current){
      if(Authentication.user && current === '/'){
        $location.path('/user-to-do');
      }
    });
  }
]);
{'fraction_non_alphanumeric': 0.16544117647058823, 'fraction_numerical': 0.0, 'mean_word_length': 4.673611111111111, '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': '3952899', 'n_tokens_mistral': 222, 'n_tokens_neox': 216, 'n_words': 49}