<commit_before>/*
  Add mixin to routes which require authentication
 */

App.AuthenticatedRouteMixin = Ember.Mixin.create({
    beforeModel: function(transition) {
        var applicationController = this.controllerFor('application');
        
        // If not logged in then display the login popup for the user.
        if (!this.controllerFor('currentUser').get('isAuthenticated')) {
            // The popup box method is on the application route
            // TODO: is there a more elegant way to call the function from here?
            var self = this;

            self.transitionTo('error.notAllowed');

            // Abort the transition as the login controller will handle the redirect after a successful login.
            // We only need to handle the case when the user clicks the close link on the login popup - this
            // is done below in a callback to the openInBox. <commit_msg>transition to signup page rather than error page<commit_after>/*
  Add mixin to routes which require authentication
 */

App.AuthenticatedRouteMixin = Ember.Mixin.create({
    beforeModel: function(transition) {
        var applicationController = this.controllerFor('application');
        
        // If not logged in then display the login popup for the user.
        if (!this.controllerFor('currentUser').get('isAuthenticated')) {
            // The popup box method is on the application route
            // TODO: is there a more elegant way to call the function from here?
            var self = this;

            self.transitionTo('signup');

            // Abort the transition as the login controller will handle the redirect after a successful login.
            // We only need to handle the case when the user clicks the close link on the login popup - this
            // is done below in a callback to the openInBox. 
{'fraction_non_alphanumeric': 0.06999457406402604, 'fraction_numerical': 0.0, 'mean_word_length': 2.446728971962617, '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': '7582204', 'n_tokens_mistral': 436, 'n_tokens_neox': 424, 'n_words': 203}