refactored out of src packages
This commit is contained in:
15
react-auth/token.ts
Normal file
15
react-auth/token.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
const TOKEN_KEY = "token";
|
||||
|
||||
export const tokenStore = {
|
||||
get(): string | null {
|
||||
return localStorage.getItem(TOKEN_KEY);
|
||||
},
|
||||
|
||||
set(token: string) {
|
||||
localStorage.setItem(TOKEN_KEY, token);
|
||||
},
|
||||
|
||||
clear() {
|
||||
localStorage.removeItem(TOKEN_KEY);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user