Pass token into Usage tracker

This commit is contained in:
Tanner Collin 2022-05-10 01:22:45 +00:00
parent 868aa018a4
commit 0911c9a7e5
2 changed files with 3 additions and 2 deletions

View File

@ -120,7 +120,7 @@ function App() {
</Route>
<Route exact path='/usage/:name'>
<Usage />
<Usage token={token} />
</Route>
<Route path='/'>

View File

@ -10,6 +10,7 @@ const deviceNames = {
};
export function Usage(props) {
const { token } = props;
const { name } = useParams();
const title = deviceNames[name].title;
const device = deviceNames[name].device;
@ -18,7 +19,7 @@ export function Usage(props) {
const ref = useRef(null);
const getUsage = () => {
requester('/stats/usage_data/?device='+device, 'GET', '')
requester('/stats/usage_data/?device='+device, 'GET', token)
.then(res => {
setUsage(res);
})