Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
fix: infra token expriry check on guard (#4219)
Mir Arif Hasane26528cedf06
diff --git a/packages/hoppscotch-backend/src/guards/infra-token.guard.ts b/packages/hoppscotch-backend/src/guards/infra-token.guard.tsindex 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);}