<commit_before>'use strict';

/* Controllers */

angular.module('roApp.controllers', [])
    .controller('BaseController', ['$scope', '$window', 'brand', 'SessionService', function($scope, $window, brand, SessionService) {
        $scope.brand = brand;

        $scope.doLogout = function() {
            SessionService.removeSession();
            $window.location = '/';
        };
    }])
    .controller('HomeController', ['$scope', 'SessionService', function($scope, SessionService) {
        $scope.session = SessionService.getSession();

        $scope.user = {};

        $scope.$on('event:login-confirmed', function() {
            console.log('event has been broadcast to Home Controller');
            $scope.session = SessionService.getSession();
        });
    }])

    // ---------------------------------------------------------------
    // This was copied from another project and needs to be reworked
    // ---------------------------------------------------------------
     .controller('RegisterController', ['$scope', 'Restangular', function($scope, Restangular) {
        $scope.user = {
            'username': '',
            'first_name':'',
            'last_name':'',
            'email':'',
            'password':''
        }


        $scope.adduser = function() {
           Restangular.one('users').customPOST($scope.user).then(function (data) {
//                $scope.user_goals = data;
                console.log(data);
            })
           $window.location = 'partials/home.html';
        }

        //console.log('In Register controller');
    }])
<commit_msg>redirect on register<commit_after>'use strict';

/* Controllers */

angular.module('roApp.controllers', [])
    .controller('BaseController', ['$scope', '$window', 'brand', 'SessionService', function($scope, $window, brand, SessionService) {
        $scope.brand = brand;

        $scope.doLogout = function() {
            SessionService.removeSession();
            $window.location = '/';
        };
    }])
    .controller('HomeController', ['$scope', 'SessionService', function($scope, SessionService) {
        $scope.session = SessionService.getSession();

        $scope.user = {};

        $scope.$on('event:login-confirmed', function() {
            console.log('event has been broadcast to Home Controller');
            $scope.session = SessionService.getSession();
        });
    }])

    // ---------------------------------------------------------------
    // This was copied from another project and needs to be reworked
    // ---------------------------------------------------------------
     .controller('RegisterController', ['$scope', 'Restangular', '$window', function($scope, Restangular, $window) {
        $scope.user = {
            'username': '',
            'first_name':'',
            'last_name':'',
            'email':'',
            'password':''
        }


        $scope.adduser = function() {
           Restangular.one('users').customPOST($scope.user).then(function (data) {
//                $scope.user_goals = data;
                console.log(data);
            })
           $window.location = 'index.html#/home';
        }

        //console.log('In Register controller');
    }])

{'fraction_non_alphanumeric': 0.23200494284831635, 'fraction_numerical': 0.0, 'mean_word_length': 1.7187237615449202, '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': '5596656', 'n_tokens_mistral': 817, 'n_tokens_neox': 790, 'n_words': 148}