Use the right header for remote IPs
This commit is contained in:
parent
2c577cb7ae
commit
ffa01ba586
5 changed files with 5 additions and 5 deletions
|
@ -8,7 +8,7 @@ const badLoginMsg = '{"error": {"message": "Incorrect login details.", "code": 6
|
|||
|
||||
export default function* (next) {
|
||||
let user = false;
|
||||
const remoteIp = this.req.headers['x-real-ip'] || this.req.connection.remoteAddress;
|
||||
const remoteIp = this.req.headers['x-forwarded-for'] || this.req.connection.remoteAddress;
|
||||
const login = yield models.login.create({
|
||||
ip: remoteIp,
|
||||
successful: false,
|
||||
|
|
|
@ -14,7 +14,7 @@ const fromname = process.env.EMAIL_NAME;
|
|||
export function* create() {
|
||||
const stripeToken = this.request.body.stripeToken;
|
||||
|
||||
const ip = this.request.headers['x-real-ip'] || this.req.connection.remoteAddress;
|
||||
const ip = this.request.headers['x-forwarded-for'] || this.req.connection.remoteAddress;
|
||||
|
||||
const createCustomer = {
|
||||
card: stripeToken.id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue