UNPKG

cdk-amazon-chime-resources

Version:

![Experimental](https://img.shields.io/badge/experimental-important.svg?style=for-the-badge)

8 lines (7 loc) 325 B
import { TokenProviderError } from "@aws-sdk/property-provider"; import { REFRESH_MESSAGE } from "./constants"; export const validateTokenExpiry = (token) => { if (token.expiration && token.expiration.getTime() < Date.now()) { throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); } };