From 0911c9a7e5d82cc43a539d2d1ab40d0afd88d9d2 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Tue, 10 May 2022 01:22:45 +0000 Subject: [PATCH] Pass token into Usage tracker --- webclient/src/App.js | 2 +- webclient/src/Usage.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/webclient/src/App.js b/webclient/src/App.js index eecb980..38ab13e 100644 --- a/webclient/src/App.js +++ b/webclient/src/App.js @@ -120,7 +120,7 @@ function App() { - + diff --git a/webclient/src/Usage.js b/webclient/src/Usage.js index 69401da..f2686f2 100644 --- a/webclient/src/Usage.js +++ b/webclient/src/Usage.js @@ -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); })