diff options
| author | Adam Soltys <[email protected]> | 2022-10-04 00:42:00 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-04 00:42:00 -0700 |
| commit | 81fc48aa58d932a19fb578e47170c06b3992d03a (patch) | |
| tree | 30b06d929a175f0e74ef1da87e3d474f9068ad6c /src/lib/utils.js | |
| parent | 63f1a6780bab85ebb48ca1fc142cc6beaf772faa (diff) | |
| download | coinos-ui-81fc48aa58d932a19fb578e47170c06b3992d03a.tar.gz coinos-ui-81fc48aa58d932a19fb578e47170c06b3992d03a.zip | |
refactoring
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 14 |
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')}` }); |
