Skip to content

Commit 80285a6

Browse files
testing ip
1 parent 0093897 commit 80285a6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/controllers/UserActionController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class UserController {
101101

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

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

@@ -268,7 +268,7 @@ class UserController {
268268
ctx.userAgent.platform +
269269
' ' +
270270
ctx.userAgent.browser,
271-
ipAddress: ctx.ip,
271+
ipAddress: ctx.request.ip,
272272
expiration: dateAddMonths(new Date(), 1),
273273
}
274274

src/routes/userActions.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const router = new Router()
88
const jwtMiddleware = jwt({ secret: process.env.JWT_SECRET })
99

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

1514
//Initial controller once for all routes

0 commit comments

Comments
 (0)