From b7fcdf0679af61d79c8a5e508f79c38f97d9fd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20H=C3=A4rtel?= Date: Sat, 14 Sep 2024 18:22:14 +0200 Subject: [PATCH] fix: Condition (#178) * Wrong way around. --- src/context/AuthContext.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/AuthContext.tsx b/src/context/AuthContext.tsx index b998414..68d7c6b 100644 --- a/src/context/AuthContext.tsx +++ b/src/context/AuthContext.tsx @@ -318,7 +318,7 @@ export const AuthContextProvider: FC = ({ children }) => { const refreshTokenData = await SecureStore.getItemAsync("accessTokenData"); const refreshTokenConfig = refreshTokenData ? new TokenResponse(JSON.parse(refreshTokenData)) : null; - if (!refreshTokenConfig || TokenResponse.isTokenFresh(refreshTokenConfig, refreshMarginSeconds)) { + if (!refreshTokenConfig || !TokenResponse.isTokenFresh(refreshTokenConfig, refreshMarginSeconds)) { // Refresh it. const response = await refreshAsync( {