From 17f47b7233264ac26aadebf65121b6b43be96206 Mon Sep 17 00:00:00 2001 From: oikkoikk Date: Sun, 8 Oct 2023 22:57:10 +0900 Subject: [PATCH] Fix : getTime() in silent refresh --- src/hooks/useAuth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useAuth.ts b/src/hooks/useAuth.ts index c8d0e15..c9c5daa 100644 --- a/src/hooks/useAuth.ts +++ b/src/hooks/useAuth.ts @@ -13,7 +13,7 @@ export default function useAuth() { const refreshToken = { refresh_token: session?.refresh_token ?? '' }; const calculateRefreshPeriod = (expiresAt: number) => { - const NOW = Math.floor(Date.now() / 1000); + const NOW = Math.floor(new Date().getTime() / 1000); return expiresAt - NOW - ONE_MINUTE_IN_MS; };