Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 8cb2ee5

Browse files
committed
Removed preact localstorage
1 parent c6d4ea2 commit 8cb2ee5

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

client/src/api/challenges.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import preactLocalStorage from 'preact-localstorage'
2-
31
export const getChallenges = () => {
4-
const auth = preactLocalStorage.get('token', 'AUTH_TOKEN_HERE')
5-
console.log(auth)
6-
72
return []
83
}

client/src/api/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { route } from 'preact-router'
2-
import preactLocalStorage from 'preact-localstorage'
32
import config from '../config'
43

54
const badToken = () => {
6-
preactLocalStorage.remove('token')
5+
localStorage.removeItem('token')
76
route('/login')
87
}
98

@@ -13,7 +12,7 @@ export const request = (method, endpoint, data) => {
1312
method,
1413
headers: {
1514
'Content-Type': 'application/json',
16-
Authorization: 'Bearer ' + preactLocalStorage.get('token')
15+
Authorization: 'Bearer ' + localStorage.getItem('token')
1716
},
1817
body: JSON.stringify(data)
1918
})

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"nyc": "^15.0.0",
4747
"preact": "^10.3.1",
4848
"preact-cli": "^2.2.1",
49-
"preact-localstorage": "^1.0.2",
5049
"preact-router": "^3.2.1",
5150
"promise-polyfill": "^8.1.3",
5251
"regenerator-runtime": "^0.13.3",

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7685,11 +7685,6 @@ preact-context@^1.1.3:
76857685
resolved "https://registry.yarnpkg.com/preact-context/-/preact-context-1.1.4.tgz#866ebd35bef5788f73fc453f06f01b03ddf8f4ff"
76867686
integrity sha512-gcCjPJ65R0MiW9hDu8W/3WAmyTElIvwLyEO6oLQiM6/TbLKLxCpBCWV8GJjx52TTEyUr60HLDcmoCXZlslelzQ==
76877687

7688-
preact-localstorage@^1.0.2:
7689-
version "1.0.2"
7690-
resolved "https://registry.yarnpkg.com/preact-localstorage/-/preact-localstorage-1.0.2.tgz#8f633dbec38e8b9222f86381275afc61b0fa3fe7"
7691-
integrity sha512-F490p/txuivO3BuFZhMYZxP14sbjqm7n5R5IeM5EP6WcO83JCVE8V1q3+Q9POlIW2y1Ql/dzXHJyDiNqKeMuqA==
7692-
76937688
preact-render-to-string@^3.6.0, preact-render-to-string@^3.8.2:
76947689
version "3.8.2"
76957690
resolved "https://registry.yarnpkg.com/preact-render-to-string/-/preact-render-to-string-3.8.2.tgz#bd72964d705a57da3a9e72098acaa073dd3ceff9"

0 commit comments

Comments
 (0)