fleet/frontend/utilities/local.js
Mike Stone dd1565936b Logout (#195)
* 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
2016-09-19 16:43:35 -07:00

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;