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.js14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js
index a4c77d58..7a988469 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -38,17 +38,6 @@ export const post = (url, body, headers) => {
});
};
-export const put = (url, body, headers) => {
- headers = { ...headers, 'content-type': 'application/json' };
- return fetch(base + url, {
- method: 'PUT',
- body: JSON.stringify(body),
- headers
- }).then(async (r) => {
- if (!r.ok) throw new Error('put failed');
- });
-};
-
export const copy = (text) => {
navigator.clipboard.writeText(text);
success('Copied!');
@@ -109,14 +98,11 @@ export const info = (m) => {
export const login = async (user, cookies) => {
let maxAge = 30 * 24 * 60 * 60;
let { token } = await post('/login', user);
- console.log('logged in', token);
let expires = new Date();
expires.setSeconds(expires.getSeconds() + maxAge);
- console.log('cs');
cookies.set('token', token, { path: '/' });
- console.log('bs');
};
export const auth = (cookies) => ({ authorization: `Bearer ${cookies.get('token')}` });