From 03277da4bb097732f2932815c145a713ad6c937b Mon Sep 17 00:00:00 2001 From: Abhinav-grd Date: Fri, 12 Mar 2021 08:46:35 +0530 Subject: [PATCH] use getToken function directly insisted of local variable to avoid in memory invalid token --- src/services/subscriptionService.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/services/subscriptionService.ts b/src/services/subscriptionService.ts index f4c947438..cc12c80a1 100644 --- a/src/services/subscriptionService.ts +++ b/src/services/subscriptionService.ts @@ -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);