1 | const storage = { |
||
2 | storeToken: function storeToken(token) { |
||
3 | localStorage.setItem("tokenDate", new Date().getTime()); |
||
0 ignored issues
–
show
|
|||
4 | localStorage.setItem("token", token); |
||
5 | }, |
||
6 | readToken: function readToken() { |
||
7 | const token = localStorage.getItem("token"); |
||
0 ignored issues
–
show
The variable
localStorage seems to be never declared. If this is a global, consider adding a /** global: localStorage */ comment.
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed. To learn more about declaring variables in Javascript, see the MDN. ![]() |
|||
8 | const tokenDate = localStorage.getItem("tokenDate"); |
||
9 | const tokenObj = { |
||
10 | token: token, |
||
11 | date: tokenDate, |
||
12 | }; |
||
13 | return tokenObj; |
||
14 | }, |
||
15 | deleteToken: function readToken() { |
||
16 | localStorage.removeItem("token"); |
||
0 ignored issues
–
show
The variable
localStorage seems to be never declared. If this is a global, consider adding a /** global: localStorage */ comment.
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed. To learn more about declaring variables in Javascript, see the MDN. ![]() |
|||
17 | localStorage.removeItem("tokenDate"); |
||
18 | }, |
||
19 | }; |
||
20 | |||
21 | export default storage; |
||
22 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.