<commit_before>var blueprint = require ('@onehilltech/blueprint'),
    request   = require('superagent'),
    util      = require ('util')
  ;

function LoginController () {
  blueprint.BaseController.call (this);
}

blueprint.controller (LoginController);

LoginController.prototype.login = function () {
    var self = this;

    return function (req, res) {

        var token;


        var userData = {
            "username": req.body.name,
            "password": <PASSWORD>
        }

        //api server requests
        request
            .post('localhost:5000/login')
            .send(userData)
            //.set('Authorization', 'bearer ' + access_token)
            .end(function (err, resp) {
                if (err) {
                    console.log(err);
                } else {
                    token = resp.body.token;
                    console.log(token);
                }

                if(token){
                    return res.render('loggedin.pug', {});
                }
                else{
                    return res.render('login.pug', {message: "Error authenticating account."});
                }
            });
    };
};

module.exports = exports = LoginController;
<commit_msg>removed //.set('Authorization', 'bearer ' + access_token)<commit_after>var blueprint = require ('@onehilltech/blueprint'),
    request   = require('superagent'),
    util      = require ('util')
  ;

function LoginController () {
  blueprint.BaseController.call (this);
}

blueprint.controller (LoginController);

LoginController.prototype.login = function () {
    var self = this;

    return function (req, res) {

        var token;


        var userData = {
            "username": req.body.name,
            "password": <PASSWORD>
        }

        //api server requests
        request
            .post('localhost:5000/login')
            .send(userData)
            .end(function (err, resp) {
                if (err) {
                    console.log(err);
                } else {
                    token = resp.body.token;
                    console.log(token);
                }

                if(token){
                    return res.render('loggedin.pug', {});
                }
                else{
                    return res.render('login.pug', {message: "Error authenticating account."});
                }
            });
    };
};

module.exports = exports = LoginController;

{'fraction_non_alphanumeric': 0.12387202625102543, 'fraction_numerical': 0.003281378178835111, 'mean_word_length': 1.4711246200607904, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 5, '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': '2956831', 'n_tokens_mistral': 663, 'n_tokens_neox': 622, 'n_words': 128}