From 81fc48aa58d932a19fb578e47170c06b3992d03a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 4 Oct 2022 00:42:00 -0700 Subject: refactoring --- src/lib/utils.js | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/lib/utils.js') 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')}` }); -- cgit v1.2.3