fix: reset GQL cache on logout

This commit is contained in:
Ali BARIN
2022-08-12 20:54:25 +02:00
parent a4a9d60d68
commit 2aeabd4be3

View File

@@ -4,6 +4,7 @@ import MenuItem from '@mui/material/MenuItem';
import Menu, { MenuProps } from '@mui/material/Menu';
import { Link } from 'react-router-dom';
import apolloClient from 'graphql/client';
import * as URLS from 'config/urls';
import useAuthentication from 'hooks/useAuthentication';
import useFormatMessage from 'hooks/useFormatMessage';
@@ -27,8 +28,10 @@ function AccountDropdownMenu(props: AccountDropdownMenuProps): React.ReactElemen
id
} = props
const logout = () => {
const logout = async () => {
authentication.updateToken('');
await apolloClient.clearStore();
onClose();
navigate(URLS.LOGIN);