From 020869c3228affa43fa24250f3ea3c5464d8efc0 Mon Sep 17 00:00:00 2001 From: dudiiiiiiii Date: Sun, 13 Oct 2024 23:41:09 +0200 Subject: [PATCH] small fix --- src/services/AuthService.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/services/AuthService.tsx b/src/services/AuthService.tsx index ca1d87de..8d2250f1 100644 --- a/src/services/AuthService.tsx +++ b/src/services/AuthService.tsx @@ -290,8 +290,7 @@ const Auth = ({ children }: GenericContextProviderProps) => { ); const tokenRefresh = useCallback(() => { - if (!initialized || !keycloak.authenticated || user?.source !== 'keycloak') - return Promise.resolve(); + if (!initialized || user?.source !== 'keycloak') return Promise.resolve(); return keycloak .updateToken(300) // 5 minutes in seconds minimum remaining lifetime for token before refresh is allowed @@ -309,9 +308,7 @@ const Auth = ({ children }: GenericContextProviderProps) => { useIntervalAsync( tokenRefresh, - initialized && keycloak.authenticated && keycloak.isTokenExpired() - ? keyCloakInterval - : undefined + initialized && keycloak.authenticated ? keyCloakInterval : undefined ); const refresh = useCallback(async () => {