Merge pull request #35 from petehunt/better-ips
Send IP address to authbox
This commit is contained in:
commit
4f22c477fa
@ -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"
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user