aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-05-15 10:23:03 -0700
committerAdam Soltys <[email protected]>2023-05-15 10:23:03 -0700
commita93391912a60682f7adc5dad775c3663532ad5a3 (patch)
tree59f990a1d9b70f59f13c097944c5740fd8dab844 /src/lib/utils.js
parent4b87ac4155e5ba4a4a46b2cde2f29eda165675ae (diff)
parent254597676393ae00d041f4d2f1c8760bf40ca5c7 (diff)
downloadcoinos-ui-a93391912a60682f7adc5dad775c3663532ad5a3.tar.gz
coinos-ui-a93391912a60682f7adc5dad775c3663532ad5a3.zip
Merge branch 'nfc'
Diffstat (limited to 'src/lib/utils.js')
-rw-r--r--src/lib/utils.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js
index 70ea5d3b..3441556f 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -25,8 +25,8 @@ export let g = (url, fetch, headers) =>
}
});
-export let get = (url, headers = {}) =>
- fetch(base + url, { headers })
+export let get = (url, headers = {}) => {
+ return fetch(base + url, { headers })
.then(async (r) => {
if (r.ok) return r.text();
throw new Error(await r.text());
@@ -38,6 +38,7 @@ export let get = (url, headers = {}) =>
return body;
}
});
+}
export let post = (url, body, headers) => {
headers = { ...headers, 'content-type': 'application/json', accept: 'application/json' };
@@ -125,8 +126,8 @@ export let info = (m) => {
});
};
-export let login = async (user, cookies, ip) => {
- let maxAge = 30 * 24 * 60 * 60;
+export let login = async (user, cookies) => {
+ let maxAge = 380 * 24 * 60 * 60;
let res = await fetch(base + '/login', {
method: 'POST',