Reset apollo cache on logout
This commit is contained in:
parent
b26d6d6e69
commit
642062dff2
|
@ -6,6 +6,7 @@ import Menu from "@material-ui/core/Menu";
|
|||
import AccountCircle from "@material-ui/icons/AccountCircle";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import { client } from "../backend/helper";
|
||||
|
||||
const useStyles = makeStyles({
|
||||
menuButton: {
|
||||
|
@ -26,7 +27,8 @@ function CustomAppBar(): React.ReactElement {
|
|||
setAnchorEl(event.currentTarget);
|
||||
};
|
||||
|
||||
const handleLogout = () => {
|
||||
const handleLogout = async () => {
|
||||
await client.resetStore();
|
||||
localStorage.removeItem("token");
|
||||
history.push("/login");
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue