Skip to content

Commit

Permalink
Fix : getTime() in silent refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
oikkoikk committed Oct 8, 2023
1 parent 2973598 commit 17f47b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 17f47b7

Please sign in to comment.