Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 467 B view raw
1const TOKEN_KEY = 'token'; 2const REFRESH_TOKEN_KEY = 'refresh_token'; 3 4export const saveAuthData = ({ token, refreshToken }) => { 5 localStorage.setItem(TOKEN_KEY, token); 6 localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken); 7}; 8 9export const getToken = () => { 10 return localStorage.getItem(TOKEN_KEY); 11}; 12 13export const getRefreshToken = () => { 14 return localStorage.getItem(REFRESH_TOKEN_KEY); 15}; 16 17export const clearStorage = () => { 18 localStorage.clear(); 19};