Skip to content

Commit

Permalink
testing ip
Browse files Browse the repository at this point in the history
  • Loading branch information
johndatserakis committed Sep 1, 2017
1 parent 0093897 commit 80285a6
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/controllers/UserActionController.js
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ class UserController {

//Let's grab their ipaddress
//TODO: This doesn't work correctly because of the reverse-proxy
request.ipAddress = ctx.ip
request.ipAddress = ctx.request.ip

//Ok, at this point we can sign them up.
try {
@@ -179,7 +179,7 @@ class UserController {
ctx.userAgent.platform +
' ' +
ctx.userAgent.browser,
ipAddress: ctx.ip,
ipAddress: ctx.request.ip,
expiration: dateAddMonths(new Date(), 1),
}

@@ -268,7 +268,7 @@ class UserController {
ctx.userAgent.platform +
' ' +
ctx.userAgent.browser,
ipAddress: ctx.ip,
ipAddress: ctx.request.ip,
expiration: dateAddMonths(new Date(), 1),
}

3 changes: 1 addition & 2 deletions src/routes/userActions.js
Original file line number Diff line number Diff line change
@@ -8,8 +8,7 @@ const router = new Router()
const jwtMiddleware = jwt({ secret: process.env.JWT_SECRET })

router.get('/', async (ctx, next) => {
console.log(ctx.request.ip)
ctx.body = { message: 'Hi there.', ctx: ctx.request.ip }
ctx.body = { message: 'Hi there. ' + process.env.npm_package_version}
})

//Initial controller once for all routes

0 comments on commit 80285a6

Please sign in to comment.