I’m building a React frontend that uses the implicit grant flow for Genesys Cloud. The docs say the token endpoint returns a JWT that I can validate locally without a backend call. I’m using jwt-decode to parse the payload, but my validation logic keeps rejecting valid tokens because the exp claim seems off. Here’s the snippet I’m using to check expiration:
const payload = jwtDecode(token);
if (payload.exp < Date.now() / 1000) {
throw new Error('Token expired');
}
The token from Genesys has an exp of 1715423400. When I run this, Date.now() / 1000 is 1715423450. The token is clearly still valid according to the Genesys admin console, but my code thinks it’s expired. I’m in America/Sao_Paulo timezone, but JWTs are UTC right? Is the Genesys token using a different epoch format or am I missing a library config flag for implicit grants?