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 | f91b6cfc87ae35bc85472422f73e328778fa4a9e (patch) | |
| tree | 30b06d929a175f0e74ef1da87e3d474f9068ad6c /src/lib/utils.js | |
| parent | 61bd51f870143bc5050946d3a012b08708aac4d1 (diff) | |
| download | coinos-ui-f91b6cfc87ae35bc85472422f73e328778fa4a9e.tar.gz coinos-ui-f91b6cfc87ae35bc85472422f73e328778fa4a9e.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')}` }); |
