<commit_before>'use strict';

const admins = ['VkekfrcDpl', 'UNBC8cqKaL', 'iIkUSpzijO'];
const isAdmin = require('../utils/app.js').isAdmin;

exports.register = (server, options, next) => {

    server.route({
        method: 'GET',
        path: '/admindashboard',
        config: {
            auth: 'hrns-cookie',
            handler: (request, reply) => {
                let opts   = { title: 'Admin Dashboard' };
                let layout = { layout: 'admin' };
                let id     = request.auth.credentials.profile.id;
                let admin  = isAdmin(id, admins);

                if (admin) {
                    request.cookieAuth.set('scope', 'admin');
                    reply.view('admindashboard', opts, layout);
                } else {
                    reply.view('message', { message: 'Sorry - it doesn\' look like you\'re an admin! Return <a href="/">home</a>'});
                }
            }
        }
    });
    return next();
};

exports.register.attributes = {
    name: 'AdminDashboard'
};<commit_msg>Adding Ben as admin and PUSHING TO MASTER :skull:<commit_after>'use strict';

const admins = ['VkekfrcDpl', '<KEY>L', 'iIkUSpzijO', 'GMtUhF0uIa'];
const isAdmin = require('../utils/app.js').isAdmin;

exports.register = (server, options, next) => {

    server.route({
        method: 'GET',
        path: '/admindashboard',
        config: {
            auth: 'hrns-cookie',
            handler: (request, reply) => {
                let opts   = { title: 'Admin Dashboard' };
                let layout = { layout: 'admin' };
                let id     = request.auth.credentials.profile.id;
                let admin  = isAdmin(id, admins);

                if (admin) {
                    request.cookieAuth.set('scope', 'admin');
                    reply.view('admindashboard', opts, layout);
                } else {
                    reply.view('message', { message: 'Sorry - it doesn\' look like you\'re an admin! Return <a href="/">home</a>'});
                }
            }
        }
    });
    return next();
};

exports.register.attributes = {
    name: 'AdminDashboard'
};
{'fraction_non_alphanumeric': 0.15308988764044945, 'fraction_numerical': 0.0009363295880149813, 'mean_word_length': 1.7188295165394403, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, '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': '1194089', 'n_tokens_mistral': 643, 'n_tokens_neox': 620, 'n_words': 143}