Skip to content

Commit

Permalink
frontend: Fix refreshToken
Browse files Browse the repository at this point in the history
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 <sannagaraj@microsoft.com>
  • Loading branch information
yolossn committed Aug 27, 2024
1 parent cb7de8a commit 80904aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/lib/k8s/apiProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async function refreshToken(token: string | null): Promise<void> {
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
Expand Down

0 comments on commit 80904aa

Please sign in to comment.