mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Add persistence to saved columns in "Hosts" table after user logs out (#1131)
- Add `removeItem` method so that we only remove the `auth_token`, and not the saved columns, from `localStorage` when the user logs out
This commit is contained in:
parent
7859784d97
commit
0255638f0b
2 changed files with 6 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ const authMiddleware = (store) => (next) => (action) => {
|
|||
if (type === LOGOUT_SUCCESS || type === LOGIN_FAILURE) {
|
||||
const { LOGIN } = PATHS;
|
||||
|
||||
local.clear();
|
||||
local.removeItem("auth_token");
|
||||
Fleet.setBearerToken(null);
|
||||
store.dispatch(push(LOGIN));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ const local = {
|
|||
|
||||
return localStorage.setItem(`FLEET::${itemName}`, value);
|
||||
},
|
||||
removeItem: (itemName) => {
|
||||
const { localStorage } = window;
|
||||
|
||||
localStorage.removeItem(`FLEET::${itemName}`);
|
||||
},
|
||||
};
|
||||
|
||||
export const authToken = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue