Skip to content

Commit

Permalink
fix: get real ip
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Oct 31, 2023
1 parent d4d32ca commit ad16d9b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/routes/auth/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ module.exports = (req, res, next) => {
if (!user) {
return next({
code: 412,
message: `Invalid auth token provided (${req.ip})`,
message: `Invalid auth token provided (${
(req.headers['x-forwarded-for'] || '').split(',')[0] ||
req.connection.remoteAddress
})`,
});
}
req.user = user;
Expand Down

0 comments on commit ad16d9b

Please sign in to comment.