From b832e0844e72b790bb7bcad24cc66434fa2eac31 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 11 Sep 2023 09:08:32 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(API/index.ts):=20add=20condi?= =?UTF-8?q?tion=20to=20check=20if=20token=20exists=20before=20making=20the?= =?UTF-8?q?=20request=20to=20renew=20access=20token=20to=20prevent=20error?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/controllers/API/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index bdf7e5221..66294ce8a 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -393,7 +393,9 @@ export async function autoLogin() { export async function renewAccessToken(token: string) { try { - return await api.post(`${BASE_URL_API}refresh?token=${token}`); + if (token) { + return await api.post(`${BASE_URL_API}refresh?token=${token}`); + } } catch (error) { console.log("Error:", error); throw error;