diff --git a/package.json b/package.json index 296d393..24d3ab3 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ } , "dependencies": { "express": "~3.5.1" - , "authbox": "^0.9.2" + , "authbox": "^0.9.3" , "jade": "~0.14.2" , "mixpanel": "~0.0.19" , "nodemailer": "~0.6.1" diff --git a/server/app.js b/server/app.js index 2f7399b..8a5d9b7 100644 --- a/server/app.js +++ b/server/app.js @@ -89,8 +89,14 @@ app.post('/intl', function(req, res) { // App helper functions function textRequestHandler(req, res, number, region, key) { + var ip = req.connection.remoteAddress; + if (!ip || ip === '127.0.0.1') { + ip = req.header('X-Real-IP'); + } + var authbox_details = { - $actionName: 'text' + $actionName: 'text', + $ipAddress: ip }; if (!number || !req.body.message) { @@ -122,11 +128,6 @@ function textRequestHandler(req, res, number, region, key) { return; } - var ip = req.connection.remoteAddress; - if (!ip || ip === '127.0.0.1') { - ip = req.header('X-Real-IP'); - } - var tracking_details = { number: number, message: req.body.message,