fix: infra token expriry check on guard (#4219)
fix: null check added in infraToken expiry check on guard
This commit is contained in:
@@ -38,7 +38,7 @@ export class InfraTokenGuard implements CanActivate {
|
|||||||
throw new UnauthorizedException(INFRA_TOKEN_INVALID_TOKEN);
|
throw new UnauthorizedException(INFRA_TOKEN_INVALID_TOKEN);
|
||||||
|
|
||||||
const currentTime = DateTime.now().toISO();
|
const currentTime = DateTime.now().toISO();
|
||||||
if (currentTime > infraToken.expiresOn.toISOString()) {
|
if (currentTime > infraToken.expiresOn?.toISOString()) {
|
||||||
throw new UnauthorizedException(INFRA_TOKEN_EXPIRED);
|
throw new UnauthorizedException(INFRA_TOKEN_EXPIRED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user