<commit_before>'use strict';

require('env2')('config.env');
const AuthCookie = require('hapi-auth-cookie');
const Hapi 			 = require('hapi');
const Bell 			 = require('bell');
const Handlebars = require('handlebars');

const Plugins 	 = require('./plugins.js');

const Auth = [Bell,  AuthCookie];


exports.init = (port, next) => {

	const server = new Hapi.Server();

	server.connection({ port: port });

	server.register(Auth, (err) => {

		if (err) throw err ;

		let authCookieOptions = {
			password: <PASSWORD>,
			cookie: 'user',
			isSecure: false,
			ttl: 1000 * 60 * 60 * 24 * 365 // 1 year
		};

		server.auth.strategy('hrns-cookie', 'cookie', authCookieOptions);

		let bellAuthOptions = {
			provider: 'linkedin',
			password: <PASSWORD>,
			clientId: process.env.CLIENT_ID,
			clientSecret: process.env.CLIENT_SECRET,
			isSecure: false
			// forceHttps:true
		};

		server.auth.strategy('linkedin-oauth', 'bell', bellAuthOptions);

		server.auth.default('hrns-cookie');
	});

	server.register(Plugins, (err) => {

		if (err) throw err ;<commit_msg>changed https<commit_after>'use strict';

require('env2')('config.env');
const AuthCookie = require('hapi-auth-cookie');
const Hapi 			 = require('hapi');
const Bell 			 = require('bell');
const Handlebars = require('handlebars');

const Plugins 	 = require('./plugins.js');

const Auth = [Bell,  AuthCookie];


exports.init = (port, next) => {

	const server = new Hapi.Server();

	server.connection({ port: port });

	server.register(Auth, (err) => {

		if (err) throw err ;

		let authCookieOptions = {
			password: <PASSWORD>,
			cookie: 'user',
			isSecure: false,
			ttl: 1000 * 60 * 60 * 24 * 365 // 1 year
		};

		server.auth.strategy('hrns-cookie', 'cookie', authCookieOptions);

		let bellAuthOptions = {
			provider: 'linkedin',
			password: <PASSWORD>,
			clientId: process.env.CLIENT_ID,
			clientSecret: process.env.CLIENT_SECRET,
			isSecure: true,
			forceHttps:true
		};

		server.auth.strategy('linkedin-oauth', 'bell', bellAuthOptions);

		server.auth.default('hrns-cookie');
	});

	server.register(Plugins, (err) => {

		if (err) throw err ;
{'fraction_non_alphanumeric': 0.16705882352941176, 'fraction_numerical': 0.01411764705882353, 'mean_word_length': 3.9099307159353347, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '857046', 'n_tokens_mistral': 832, 'n_tokens_neox': 713, 'n_words': 161}