File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ const router = new Router()
88const jwtMiddleware = jwt ( { secret : process . env . JWT_SECRET } )
99
1010router . 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
You can’t perform that action at this time.
0 commit comments