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

  angular
    .module('static')
    .controller('IndexController', IndexController);

  /** @ngInject */
  function IndexController($rootScope, AuthService) {
    var vm = this;

    /*
    IndexController is used for keeping track of authentication 
    state and other app-wide information.
    */

    vm.currentUser = null;

    vm.isAuthenticated = AuthService.isAuthenticated;

    vm.currentUserWatch = $rootScope.$on('AUTH_EVENTS.loginSuccess', function setCurrentUser (user) {
      vm.currentUser = user;
      console.info('current user:', user);
    });<commit_msg>Redirect to login when not authenticated<commit_after>(function() {
  'use strict';

  angular
    .module('static')
    .controller('IndexController', IndexController);

  /** @ngInject */
  function IndexController($scope, $state, AUTH_EVENTS) {
    var vm = this;

    // Set up watchers for authentication issues
    $scope.$on(AUTH_EVENTS.notAuthenticated, redirectToLogin);

    function redirectToLogin () {

      $state.go('login');
    }
{'fraction_non_alphanumeric': 0.12429906542056075, 'fraction_numerical': 0.0, 'mean_word_length': 3.538135593220339, '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': '5313795', 'n_tokens_mistral': 312, 'n_tokens_neox': 300, 'n_words': 72}