<commit_before>var openid = require('openid');
var url = require('url');
var nonLoginPaths = {
    "/login" : true,
    "/favicon.ico" : true
};

var conf = {
    "dev" : {
        "host" : "http://localhost:5000"
    },
    "production" : {
        "host" : "http://business-game.kbsbng.com"
    }
};
var env = "dev";
if (process.env.NODE_ENV == "production") {
    env ="production";
}
var config = conf[env];
var nonLoginPatterns = [ '^/combo~', '^/static' ];
module.exports = 
    function(req, res, next) {
        console.log(req.headers);
        console.log("called login handler: " + req.url);
        var parsedUrl = url.parse(req.url, true);
        var i;
        var relyingParty = new openid.RelyingParty(
            config.host + "/verify",
            null,
          false,
            false,
            []);

        console.log(parsedUrl);
        if(parsedUrl.pathname === "/authenticate") {
             relyingParty.authenticate(parsedUrl.query['openid-identifier'],
                 false,
                 function(error, authUrl) {
                     if (error) {
                         res.writeHead(200);
                         res.end('Authentication failed: ' + error.message);
                         return;
                     }
                     if (!authUrl) {
                         res.writeHead(200);
                         res.end('Authentication failed');
                         return;
                     }
<commit_msg>Adding realm<commit_after>var openid = require('openid');
var url = require('url');
var nonLoginPaths = {
    "/login" : true,
    "/favicon.ico" : true
};

var conf = {
    "dev" : {
        "host" : "http://localhost:5000"
    },
    "production" : {
        "host" : "http://business-game.kbsbng.com"
    }
};
var env = "dev";
if (process.env.NODE_ENV == "production") {
    env ="production";
}
var config = conf[env];
var nonLoginPatterns = [ '^/combo~', '^/static' ];
module.exports = 
    function(req, res, next) {
        console.log(req.headers);
        console.log("called login handler: " + req.url);
        var parsedUrl = url.parse(req.url, true);
        var i;
        var relyingParty = new openid.RelyingParty(
            config.host + "/verify",
            config.host + "/",
          false,
            false,
            []);

        console.log(parsedUrl);
        if(parsedUrl.pathname === "/authenticate") {
             relyingParty.authenticate(parsedUrl.query['openid-identifier'],
                 false,
                 function(error, authUrl) {
                     if (error) {
                         res.writeHead(200);
                         res.end('Authentication failed: ' + error.message);
                         return;
                     }
                     if (!authUrl) {
                         res.writeHead(200);
                         res.end('Authentication failed');
                         return;
                     }

{'fraction_non_alphanumeric': 0.14098250336473755, 'fraction_numerical': 0.006729475100942127, 'mean_word_length': 1.452970297029703, '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': '615019', 'n_tokens_mistral': 869, 'n_tokens_neox': 817, 'n_words': 159}