This repository was archived by the owner on Feb 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +34
-0
lines changed Expand file tree Collapse file tree 5 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ import preactLocalStorage from 'preact-localstorage'
2
+
3
+ export const getChallenges = ( ) => {
4
+ const auth = preactLocalStorage . get ( 'token' , 'AUTH_TOKEN_HERE' )
5
+ console . log ( auth )
6
+
7
+ return [ ]
8
+ }
Original file line number Diff line number Diff line change
1
+ import { route } from 'preact-router'
2
+ import preactLocalStorage from 'preact-localstorage'
3
+
4
+ const badToken = ( ) => {
5
+ preactLocalStorage . get ( 'token' , 'AUTH_TOKEN_HERE' )
6
+ route ( '/login' )
7
+ }
8
+
9
+ export const request = ( method , endpoint , data ) => {
10
+ // fetch endpoint with HTTP method, data as body
11
+
12
+ badToken ( )
13
+ }
Original file line number Diff line number Diff line change
1
+ import preactLocalStorage from 'preact-localstorage'
2
+ import { route } from 'preact-router'
3
+
4
+ export const login = teamToken => {
5
+ preactLocalStorage . set ( 'token' , 'AUTH_TOKEN_HERE' )
6
+ route ( '/challenges' )
7
+ }
Original file line number Diff line number Diff line change 39
39
"nyc" : " ^15.0.0" ,
40
40
"preact" : " ^10.3.1" ,
41
41
"preact-cli" : " ^2.2.1" ,
42
+ "preact-localstorage" : " ^1.0.2" ,
42
43
"preact-router" : " ^3.2.1" ,
43
44
"promise-polyfill" : " ^8.1.3" ,
44
45
"regenerator-runtime" : " ^0.13.3" ,
Original file line number Diff line number Diff line change @@ -6595,6 +6595,11 @@ preact-context@^1.1.3:
6595
6595
version "1.1.4"
6596
6596
resolved "https://registry.yarnpkg.com/preact-context/-/preact-context-1.1.4.tgz#866ebd35bef5788f73fc453f06f01b03ddf8f4ff"
6597
6597
6598
+ preact-localstorage@^1.0.2 :
6599
+ version "1.0.2"
6600
+ resolved "https://registry.yarnpkg.com/preact-localstorage/-/preact-localstorage-1.0.2.tgz#8f633dbec38e8b9222f86381275afc61b0fa3fe7"
6601
+ integrity sha512-F490p/txuivO3BuFZhMYZxP14sbjqm7n5R5IeM5EP6WcO83JCVE8V1q3+Q9POlIW2y1Ql/dzXHJyDiNqKeMuqA==
6602
+
6598
6603
preact-render-to-string@^3.6.0, preact-render-to-string@^3.8.2 :
6599
6604
version "3.8.2"
6600
6605
resolved "https://registry.yarnpkg.com/preact-render-to-string/-/preact-render-to-string-3.8.2.tgz#bd72964d705a57da3a9e72098acaa073dd3ceff9"
You can’t perform that action at this time.
0 commit comments