Continuing on micro workers, and corrected some bugs
This commit is contained in:
@@ -1,12 +1,28 @@
|
||||
var db = require('../prototype/dbrequests.js');
|
||||
var vcode = require('../../lib/vcode.js');
|
||||
|
||||
module.exports.index = function(req, res) {
|
||||
|
||||
req.session = null;
|
||||
res.locals.session = null;
|
||||
db.verifyUser(req.session.userId, function(ok) {
|
||||
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
if (ok) {
|
||||
|
||||
res.locals.vcode = vcode(req.session.workerId, req.session.campaignIp);
|
||||
|
||||
}
|
||||
|
||||
res.locals.workerId = req.session.workerId;
|
||||
req.session = null;
|
||||
res.locals.session = null;
|
||||
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
|
||||
res.render('index.jade', res.locals, function(err, result) {
|
||||
console.log(err);
|
||||
res.send(result);
|
||||
});
|
||||
|
||||
res.render('index.jade', res.locals, function(err, result) {
|
||||
res.send(result);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -6,3 +6,8 @@ block content
|
||||
source(src="/static/data/music/thankyou.ogg")
|
||||
source(src="/static/data/music/thankyou.mp3")
|
||||
|
||||
if (vcode !== undefined)
|
||||
p Your vcode is #{vcode}.
|
||||
else if (workerId !== undefined)
|
||||
p You have no vcode because you're bad
|
||||
|
||||
|
||||
Reference in New Issue
Block a user