Files
aman-frontend/src/components/overview.tsx
2022-11-03 02:01:18 +01:00

15 lines
412 B
TypeScript

import React, { useState } from 'react';
import axios from 'axios';
export const Overview: React.FC = () => {
const [msg, setMsg] = useState('LOADING');
axios.get('http://localhost:3000/auth/user', {
headers: {
Authorization: `Bearer ${sessionStorage.getItem('token')}`,
},
}).then((data) => setMsg(data.data)).catch(() => setMsg('FAILED'));
return <>OVERVIEW {msg}</>;
};