'use strict';

var sysconfig = require('../../lib/sysconfig.js');
var config = require('../../lib/configuration.js');
var EventProxy = require('eventproxy');
var request = require('request');

var userInfo = config.get('user');
var ep = new EventProxy();

// check user is login.
ep.tail('is-login', function() {
    var options = {
        url: sysconfig.api('islogin'),
        headers: {
            user: userInfo.name,
            token: userInfo.token,
        }
    }

    // send request
    request.get(options, function(err, response, body) {});
});

@@ -549,12 +549,296 @@
 y) %7B%7D);%0A%7D);%0A
+%0Aep.tail('login',function() %7B%0A    var options = %7B%0A        url: sysconfig.api('login'),%0A        headers: %7B%0A            user: userInfo.name,%0A            password: userInfo.password,%0A        %7D%0A    %7D%0A%0A    // send request%0A    request.get(options, function(err, response, body) %7B%7D);    %0A%7D);

add login code block.