From 80904aa237b2f63eaa3ddd9644c668399672ad05 Mon Sep 17 00:00:00 2001 From: yolossn Date: Tue, 27 Aug 2024 16:20:01 +0530 Subject: [PATCH] frontend: Fix refreshToken the token expiry check in refreshToken was failing when the decodeToken returned null.this patch adds a check to see if the decodedToken exists before accessing the .exp property Signed-off-by: yolossn --- frontend/src/lib/k8s/apiProxy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/k8s/apiProxy.ts b/frontend/src/lib/k8s/apiProxy.ts index 51912e0e62..2dd6383d12 100644 --- a/frontend/src/lib/k8s/apiProxy.ts +++ b/frontend/src/lib/k8s/apiProxy.ts @@ -208,7 +208,7 @@ async function refreshToken(token: string | null): Promise { const decodedToken: any = decodeToken(token); // return if the token doesn't have an expiry time - if (!decodedToken.exp) { + if (!decodedToken?.exp) { return; } // convert expiry seconds to date object