<commit_before>Router.configure({
    layoutTemplate:'layout',
    loadingTemplate:'preloader',
});

Router.map(function() {
    this.route('index', {path : '/'});
    this.route('signUp', {path : 'sign-up'});
    this.route('logIn', {path : 'log-in'});
    this.route('uploader', {path : 'upload'});
    this.route('notVerified', {path : 'not-verified'});
    this.route('filemanager', {path : 'filemanager'});
    this.route('modelViewer', {
	path: '/models/:_id',
	data: function() 
	{ 
	    return Models.findOne (this.params._id);
	}
    });
});

var validateUser = function(pause) {
    if (Meteor.user()) {
	if (Meteor.user().emails[0].verified) {
	    this.render();
	} else {
	    this.render('notVerified');
        }
    } 
    pause();
}

var loggingIn = function(pause) {
	if (Meteor.loggingIn()) {
	    this.render('preloader');
	}
}

Router.onBeforeAction(loggingIn);
Router.onBeforeAction(validateUser,{only:['uploader','filemanager']});<commit_msg>show login forms when not logged in<commit_after>Router.configure({
    layoutTemplate:'layout',
    loadingTemplate:'preloader',
});

Router.map(function() {
    this.route('index', {path : '/'});
    this.route('signUp', {path : 'sign-up'});
    this.route('logIn', {path : 'log-in'});
    this.route('uploader', {path : 'upload'});
    this.route('notVerified', {path : 'not-verified'});
    this.route('filemanager', {path : 'filemanager'});
    this.route('modelViewer', {
	path: '/models/:_id',
	data: function() 
	{ 
	    return Models.findOne (this.params._id);
	}
    });
});

var validateUser = function(pause) {
    if (Meteor.user()) {
	if (Meteor.user().emails[0].verified) {
	    this.render();
	} else {
	    this.render('notVerified');
        }
    } else {
	this.render('logIn');
    } 
    pause();
}

var loggingIn = function(pause) {
	if (Meteor.loggingIn()) {
	    this.render('preloader');
	}
}

Router.onBeforeAction(loggingIn);
Router.onBeforeAction(validateUser,{only:['uploader','filemanager']});
{'fraction_non_alphanumeric': 0.20824949698189135, 'fraction_numerical': 0.001006036217303823, 'mean_word_length': 3.8159806295399514, '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': '6227216', 'n_tokens_mistral': 709, 'n_tokens_neox': 688, 'n_words': 103}