mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
dd1565936b
* moves login page styles to reusable component * Redirects successful login to homepage after 3s * Adds logout form * Adds logout page * Adds logout link to homepage * Adds gravatarURL to logged in user * Configure API Client to hit /me endpoint * Fetch user when the app loads * Configured API Client to make logout requests * Handle logout flow in redux * Logout form styles * Logout user when the logout form is submitted
29 lines
631 B
JavaScript
29 lines
631 B
JavaScript
import config from '../config';
|
|
|
|
const { window } = global;
|
|
const { settings } = config;
|
|
|
|
const local = {
|
|
clear: () => {
|
|
const { localStorage } = window;
|
|
|
|
localStorage.clear();
|
|
},
|
|
getItem: (itemName) => {
|
|
const { localStorage } = window;
|
|
const { env } = settings;
|
|
|
|
return localStorage.getItem(`KOLIDE-${env}::${itemName}`);
|
|
},
|
|
setItem: (itemName, value) => {
|
|
const { localStorage } = window;
|
|
const { env } = settings;
|
|
|
|
return localStorage.setItem(`KOLIDE-${env}::${itemName}`, value);
|
|
},
|
|
};
|
|
|
|
export const authToken = () => { return local.getItem('auth_token'); };
|
|
|
|
export default local;
|