Permalink
Browse files

Send IP address to authbox

  • Loading branch information...
1 parent 6728cc0 commit 84eab487fd20c5abad08e4c1c9815b22a3149b30 @petehunt petehunt committed Jan 3, 2015
Showing with 8 additions and 7 deletions.
  1. +1 −1 package.json
  2. +7 −6 server/app.js
View
@@ -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"
View
@@ -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,

0 comments on commit 84eab48

Please sign in to comment.