From 092fe68e09434ed290bcb0e1b8076d3852901e5f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 9 May 2023 13:44:09 -0700 Subject: pass ip to login endpoint --- src/lib/utils.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/utils.js') diff --git a/src/lib/utils.js b/src/lib/utils.js index 5eef79fc..69606d36 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -119,13 +119,17 @@ export let info = (m) => { }); }; -export let login = async (user, cookies) => { +export let login = async (user, cookies, ip) => { let maxAge = 30 * 24 * 60 * 60; let res = await fetch(base + '/login', { method: 'POST', body: JSON.stringify(user), - headers: { 'content-type': 'application/json', accept: 'application/json' } + headers: { + 'content-type': 'application/json', + accept: 'application/json', + 'cf-connecting-ip': ip + } }); if (res.status === 401) { let text = await res.text(); -- cgit v1.2.3