From fb641b54e860237f0130b352055297ee45073586 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Wed, 13 Mar 2024 20:23:57 +0100 Subject: [PATCH] fix: token expiry Signed-off-by: Timo Glastra --- packages/issuer/lib/tokens/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/issuer/lib/tokens/index.ts b/packages/issuer/lib/tokens/index.ts index 06222703..7fe85786 100644 --- a/packages/issuer/lib/tokens/index.ts +++ b/packages/issuer/lib/tokens/index.ts @@ -44,11 +44,12 @@ export const generateAccessToken = async ( ): Promise => { const { accessTokenIssuer, alg, accessTokenSignerCallback, tokenExpiresIn, preAuthorizedCode } = opts const iat = new Date().getTime() + const exp = iat + tokenExpiresIn const jwt: Jwt = { header: { typ: 'JWT', alg: alg ?? Alg.ES256K }, payload: { iat, - exp: tokenExpiresIn, + exp, iss: accessTokenIssuer, ...(preAuthorizedCode && { preAuthorizedCode }), },