aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
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
commit54c9cbe0263e7a2d6e21d04eea7246b566d6ba7f (patch)
tree59f990a1d9b70f59f13c097944c5740fd8dab844 /src/lib
parent7974e1565a0dc3a1809d84fefc1feb90b0d83383 (diff)
parent4e02fbdff1ed48327c9ed688bac214b84d487c93 (diff)
downloadcoinos-ui-54c9cbe0263e7a2d6e21d04eea7246b566d6ba7f.tar.gz
coinos-ui-54c9cbe0263e7a2d6e21d04eea7246b566d6ba7f.zip
Merge branch 'nfc'
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/store.js1
-rw-r--r--src/lib/utils.js9
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/store.js b/src/lib/store.js
index 4e88c90c..923bda52 100644
--- a/src/lib/store.js
+++ b/src/lib/store.js
@@ -52,3 +52,4 @@ export const request = writable();
export const requestRedirect = writable();
export const token = persistSession('token');
export const user = writable();
+export const ndef = writable();
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',