From 3d1b807bcdb9f381108a0cf18beb90bc2b370711 Mon Sep 17 00:00:00 2001 From: stdavis Date: Fri, 12 Aug 2022 16:14:54 -0600 Subject: [PATCH] fix: convert token expire to ticks --- _src/react-app/hooks/useAuthentication.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_src/react-app/hooks/useAuthentication.js b/_src/react-app/hooks/useAuthentication.js index a8ac5532..ed33db23 100644 --- a/_src/react-app/hooks/useAuthentication.js +++ b/_src/react-app/hooks/useAuthentication.js @@ -67,14 +67,14 @@ export default function useAuthentication() { if (checkClaims(response.claims)) { await initServiceWorker(); sendTokenToServiceWorker(response.token); - expireTime = response.expirationTime; + expireTime = new Date(response.expirationTime).getTime(); if (!window.Cypress) { intervalId = setInterval(async () => { if (Date.now() > expireTime) { console.log('refreshing token'); const response = await result.user.getIdTokenResult(); - expireTime = response.expirationTime; + expireTime = new Date(response.expirationTime).getTime(); sendTokenToServiceWorker(response.token); } }, config.authTokenCheckInterval);