aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utils.js')
-rw-r--r--src/lib/utils.js8
1 files changed, 6 insertions, 2 deletions
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();