fix: infra token expriry check on guard (#4219)

fix: null check added in infraToken expiry check on guard
This commit is contained in:
Mir Arif Hasan 2024-07-29 20:08:17 +06:00 committed by GitHub
parent c9f92282bf
commit e26528cedf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}