diff options
| author | Adam Soltys <[email protected]> | 2023-05-09 13:44:09 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-05-09 13:44:09 -0700 |
| commit | 11621061c6c6b2e70f2974b7e09026b6aad1f666 (patch) | |
| tree | 597679db6e65ce3b743dac7f4e8d8ffee52b3e52 /src/lib/utils.js | |
| parent | deaf3f46217e91a987fbee0563a5586b337aafd1 (diff) | |
| download | coinos-ui-11621061c6c6b2e70f2974b7e09026b6aad1f666.tar.gz coinos-ui-11621061c6c6b2e70f2974b7e09026b6aad1f666.zip | |
pass ip to login endpoint
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 8 |
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(); |
