use getToken function directly insisted of local variable to avoid in memory invalid token

This commit is contained in:
Abhinav-grd 2021-03-12 08:46:35 +05:30
parent 9451b3ae1b
commit 03277da4bb

View file

@ -3,7 +3,6 @@ import { getToken } from 'utils/common/key';
import HTTPService from './HTTPService';
const ENDPOINT = getEndpoint();
const token = getToken();
export interface Subscription {
id: number;
@ -21,7 +20,7 @@ class SubscriptionService {
`${ENDPOINT}/billing/usage`,
{ startTime: 0, endTime: Date.now() * 1000 },
{
'X-Auth-Token': token,
'X-Auth-Token': getToken(),
}
);
return this.convertBytesToGBs(response.data.usage);