Pass token into Usage tracker

master
Tanner Collin 2 years ago
parent 868aa018a4
commit 0911c9a7e5
  1. 2
      webclient/src/App.js
  2. 3
      webclient/src/Usage.js

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

@ -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);
})

Loading…
Cancel
Save