<commit_before>angular.module('Coffee-time')
  .factory('Auth', ['$http', '$location', '$rootScope', '$cookieStore',
    function($http, $location, $rootScope, $cookieStore) {
      $rootScope.currentUser = $cookieStore.get('persona');
      $cookieStore.remove('persona');

      return {
        login: function(persona) {
          return $http.post('/api/login', persona)
            .success(function(data) {
              $rootScope.currentUser = data;
              $location.path('/');
            })
            .error(function() {
            });
        },
        signup: function(persona) {
          return $http.post('/api/signup', persona)
            .success(function() {
              $location.path('/login');

              })
            .error(function(response) {
              
            });
        },
        logout: function() {
          return $http.get('/api/logout').success(function() {
            $rootScope.currentUser = null;
            $cookieStore.remove('user');
          });
        }
      };
    }]);<commit_msg>After logout redirects to login<commit_after>angular.module('Coffee-time')
  .factory('Auth', ['$http', '$location', '$rootScope', '$cookieStore',
    function($http, $location, $rootScope, $cookieStore) {
      $rootScope.currentUser = $cookieStore.get('persona');
      $cookieStore.remove('persona');

      return {
        login: function(persona) {
          return $http.post('/api/login', persona)
            .success(function(data) {
              $rootScope.currentUser = data;
              $location.path('/');
            })
            .error(function() {
            });
        },
        signup: function(persona) {
          return $http.post('/api/signup', persona)
            .success(function() {
              $location.path('/login');

              })
            .error(function(response) {
              
            });
        },
        logout: function() {
          return $http.get('/api/logout').success(function() {
            $rootScope.currentUser = null;
            $cookieStore.remove('user');
            $location.path('/login');   
          });
        }
      };
    }]);
{'fraction_non_alphanumeric': 0.16628387689480936, 'fraction_numerical': 0.0, 'mean_word_length': 1.7055900621118012, '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': '6238882', 'n_tokens_mistral': 591, 'n_tokens_neox': 584, 'n_words': 83}