<commit_before>var path = require('path');

var publicPath = path.join(__dirname, '../public');

/**
 * Handles a call to / and shows some text with links to login and registration
 */
exports.index = {
	auth: {
		mode: 'try',
		strategy: 'session'
	},
	handler: function (request, reply) {

		if (request.auth.isAuthenticated) {
			// The user is already logged in, redirect it to the hideout
			return reply.redirect('/dashboard');
		}

		var data =
		'<h1> Hi there! </h1>' +
		'<p> Would you like to <a href="login">login</a> or <a href="signup">signup</a>? </p>';

    return reply.view('index', {title: 'Main'});
	}
};

/**
 * Handles a call to /login and shows a login form
 */
exports.login = {
	auth: {
		mode: 'try',
		strategy: 'session'
	},
	handler: function (request, reply) {

		if (request.auth.isAuthenticated) {
			// The user is already logged in, redirect it to the hideout
			return reply.redirect('/dashboard');
		}

		var form =
		'<h1> Login </h1>' +
		'<form method="post" action="login">' +
		'	<p><input type="text"     name="email"    value="" placeholder="E-mail"></p>' +
		'	<p><input type="password" name="password" value="" placeholder="Password"></p>' +
		'	<p><input type="submit"   value="Login"></p>' +
		'</form>';

   		return reply.view('templates/login/index', {title: "Login"});
	}
};

/**
 * Handles a call to /signup and shows a registration form
 */
exports.signup = {
	auth: {
		mode: 'try',
		strategy: 'session'
	},
	handler: function (request, reply) {

		if (request.auth.isAuthenticated) {
			// The user is already logged in, redirect it to the hideout
			return reply.redirect('/dashboard');
		}

		var form =
		'<h1> Sign Up </h1>' +
		'<form method="post" action="signup">' +
		'	<p><input type="text"     name="email"    value="" placeholder="E-mail"></p>' +
		'	<p><input type="password" name="password" value="" placeholder="Password"></p>' +
		'	<p><input type="submit"   value="signup"></p>' +
		'</form>';

    	return reply(form);
	}
};

/**
 * Handles a call to /dashboard and shows super secret stuff
 */
exports.secret = {
	auth: 'session',
	handler: function (request, reply) {
		var data =
		'<h1> Batman\'s super secret hideout! </h1>' +
		'<p> Welcome to this totally secret hideout, ' + request.auth.credentials.email + '. Would you like to <a href="logout">leave</a>? </p>';

    	return reply(data);
	}
};
<commit_msg>routed the signup to reflect new template route and also added a new export assets to cover for public files<commit_after>var path = require('path');

var publicPath = path.join(__dirname, '../public');

/**
 * Handles a call to / and shows some text with links to login and registration
 */
exports.index = {
	auth: {
		mode: 'try',
		strategy: 'session'
	},
	handler: function (request, reply) {

		if (request.auth.isAuthenticated) {
			// The user is already logged in, redirect it to the hideout
			return reply.redirect('/dashboard');
		}

		var data =
		'<h1> Hi there! </h1>' +
		'<p> Would you like to <a href="login">login</a> or <a href="signup">signup</a>? </p>';

    return reply.view('index', {title: 'Main'});
	}
};

/**
 * Handles a call to /login and shows a login form
 */
exports.login = {
	auth: {
		mode: 'try',
		strategy: 'session'
	},
	handler: function (request, reply) {

		if (request.auth.isAuthenticated) {
			// The user is already logged in, redirect it to the hideout
			return reply.redirect('/dashboard');
		}

		var form =
		'<h1> Login </h1>' +
		'<form method="post" action="login">' +
		'	<p><input type="text"     name="email"    value="" placeholder="E-mail"></p>' +
		'	<p><input type="password" name="password" value="" placeholder="Password"></p>' +
		'	<p><input type="submit"   value="Login"></p>' +
		'</form>';

   		return reply.view('templates/login/index', {title: "Login"});
	}
};

/**
 * Handles a call to /signup and shows a registration form
 */
exports.signup = {
	auth: {
		mode: 'try',
		strategy: 'session'
	},
	handler: function (request, reply) {

		if (request.auth.isAuthenticated) {
			// The user is already logged in, redirect it to the hideout
			return reply.redirect('/dashboard');
		}

		var form =
		'<h1> Sign Up </h1>' +
		'<form method="post" action="signup">' +
		'	<p><input type="text" name="email"    value="" placeholder="E-mail"></p>' +
		'	<p><input type="password" name="password" value="" placeholder="Password"></p>' +
		'	<p><input type="submit" value="Sign Up"></p>' +
		'</form>';

    	return reply.view('templates/signup/index', {title: 'Sign Up'});
	}
};

/**
 * Handles a call to /dashboard and shows super secret stuff
 */
exports.secret = {
	auth: 'session',
	handler: function (request, reply) {
		var data =
		'<h1> Batman\'s super secret hideout! </h1>' +
		'<p> Welcome to this totally secret hideout, ' + request.auth.credentials.email + '. Would you like to <a href="logout">leave</a>? </p>';

    	return reply(data);
	}
};

exports.assets = {
	handler: {
		directory: {
			path: './public'
		}
	}
}

{'fraction_non_alphanumeric': 0.18801362998596913, 'fraction_numerical': 0.0032070555221487274, 'mean_word_length': 3.5199275362318843, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, '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': '7108669', 'n_tokens_mistral': 1804, 'n_tokens_neox': 1698, 'n_words': 488}