Merge pull request #445 from automatisch/issue-442

fix: reset GQL cache on logout
This commit is contained in:
Ömer Faruk Aydın
2022-08-13 00:00:20 +03:00
committed by GitHub

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);