@theredhead — Frontend Library - v1.0.0
    Preparing search index...
    • Check whether a decoded JWT is expired.

      Parameters

      • payload: JwtPayload

        The decoded JWT payload.

      • nowSeconds: number = ...

        Current time in seconds since epoch. Defaults to Math.floor(Date.now() / 1000).

      • clockToleranceSeconds: number = 0

        Grace period in seconds. Defaults to 0.

      Returns boolean

      true if the token has an exp claim and it is in the past.

      if (isExpired(jwt.payload)) {
      // refresh or redirect to login
      }