Merge pull request #445 from automatisch/issue-442
fix: reset GQL cache on logout
This commit is contained in:
@@ -4,6 +4,7 @@ import MenuItem from '@mui/material/MenuItem';
|
|||||||
import Menu, { MenuProps } from '@mui/material/Menu';
|
import Menu, { MenuProps } from '@mui/material/Menu';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
|
import apolloClient from 'graphql/client';
|
||||||
import * as URLS from 'config/urls';
|
import * as URLS from 'config/urls';
|
||||||
import useAuthentication from 'hooks/useAuthentication';
|
import useAuthentication from 'hooks/useAuthentication';
|
||||||
import useFormatMessage from 'hooks/useFormatMessage';
|
import useFormatMessage from 'hooks/useFormatMessage';
|
||||||
@@ -27,8 +28,10 @@ function AccountDropdownMenu(props: AccountDropdownMenuProps): React.ReactElemen
|
|||||||
id
|
id
|
||||||
} = props
|
} = props
|
||||||
|
|
||||||
const logout = () => {
|
const logout = async () => {
|
||||||
authentication.updateToken('');
|
authentication.updateToken('');
|
||||||
|
await apolloClient.clearStore();
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
|
|
||||||
navigate(URLS.LOGIN);
|
navigate(URLS.LOGIN);
|
||||||
|
Reference in New Issue
Block a user