<commit_before>'use strict';

angular.module('myApp.register', [
  'ngRoute',
  'firebase'
])

  // Declared route
  .config(['$routeProvider', function ($routeProvider) {
    $routeProvider.when('/register', {
      templateUrl: 'register/register.html',
      controller: 'RegisterCtrl'
    });
  }])

  // Register controller
  .controller('RegisterCtrl', ['$scope', '$firebaseAuth', function ($scope, $firebaseAuth) {

    var firebaseObj = new Firebase("https://angular-and-firebase.firebaseio.com/");
    var auth = $firebaseAuth(firebaseObj);

    $scope.SignUp = function () {
      if (!$scope.regForm.$invalid) {

        var email = $scope.user.email;
        var password = $<PASSWORD>;
        if (email && password) {
          auth.$createUser(email, password)
            .then(function () {
              console.log('User creation successful');
            }, function (error) {
              console.log(error);
            })
        }

      }
    };

  }]);<commit_msg>added redirect to login after register<commit_after>'use strict';

angular.module('myApp.register', [
  'ngRoute',
  'firebase'
])

  // Declared route
  .config(['$routeProvider', function ($routeProvider) {
    $routeProvider.when('/register', {
      templateUrl: 'register/register.html',
      controller: 'RegisterCtrl'
    });
  }])

  // Register controller
  .controller('RegisterCtrl', ['$scope', '$location', '$firebaseAuth', function ($scope, $location, $firebaseAuth) {

    var firebaseObj = new Firebase("https://angular-and-firebase.firebaseio.com/");
    var auth = $firebaseAuth(firebaseObj);

    $scope.SignUp = function () {
      if (!$scope.regForm.$invalid) {

        var email = $scope.user.email;
        var password = $scope.<PASSWORD>;
        if (email && password) {
          auth.$createUser(email, password)
            .then(function () {
              console.log('User creation successful');
              $location.path('/home');
            }, function (error) {
              console.log(error);
            })
        }

      }
    };

  }]);
{'fraction_non_alphanumeric': 0.16233140655105974, 'fraction_numerical': 0.0, 'mean_word_length': 2.4848993288590604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3185225', 'n_tokens_mistral': 604, 'n_tokens_neox': 590, 'n_words': 112}