fix: reduce refresh access token calls

This commit is contained in:
Elias Schneider
2024-02-27 09:40:52 +01:00
parent 4dae7e250a
commit 1aa3d8e5e8
2 changed files with 9 additions and 2 deletions

View File

@@ -50,7 +50,12 @@ function App({ Component, pageProps }: AppProps) {
}, [router.pathname]);
useEffect(() => {
setInterval(async () => await authService.refreshAccessToken(), 30 * 1000);
const interval = setInterval(
async () => await authService.refreshAccessToken(),
2 * 60 * 1000, // 2 minutes
);
return () => clearInterval(interval);
}, []);
useEffect(() => {