-
Defendi Alberto authoredDefendi Alberto authored
ProfilePage.tsx 588 B
import React, { FC } from 'react';
import Button from '@material-ui/core/Button';
import axios from 'axios';
import { NonAuthRoutes } from 'components/api/routes';
import { useHistory } from 'react-router-dom';
export const ProfilePage: FC = () => {
const history = useHistory();
const logout = (): void => {
axios
.post('/api/web/login/logout')
.then(() => history.replace(NonAuthRoutes.home));
};
return (
<div data-testid="ProfilePage">
<Button variant="outlined" color="default" onClick={logout}>
Logout
</Button>
</div>
);
};