From e26528cedf06eff797b81ec2ac844679f691854e Mon Sep 17 00:00:00 2001 From: Mir Arif Hasan Date: Mon, 29 Jul 2024 20:08:17 +0600 Subject: [PATCH] fix: infra token expriry check on guard (#4219) fix: null check added in infraToken expiry check on guard --- packages/hoppscotch-backend/src/guards/infra-token.guard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hoppscotch-backend/src/guards/infra-token.guard.ts b/packages/hoppscotch-backend/src/guards/infra-token.guard.ts index bc5e56903..e627b3fcb 100644 --- a/packages/hoppscotch-backend/src/guards/infra-token.guard.ts +++ b/packages/hoppscotch-backend/src/guards/infra-token.guard.ts @@ -38,7 +38,7 @@ export class InfraTokenGuard implements CanActivate { throw new UnauthorizedException(INFRA_TOKEN_INVALID_TOKEN); const currentTime = DateTime.now().toISO(); - if (currentTime > infraToken.expiresOn.toISOString()) { + if (currentTime > infraToken.expiresOn?.toISOString()) { throw new UnauthorizedException(INFRA_TOKEN_EXPIRED); }