Skip to content

Commit 1919f50

Browse files
authored
Merge pull request #99 from TimoGlastra/fix/token-exp
fix: token expiry
2 parents b054c24 + fb641b5 commit 1919f50

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/issuer/lib/tokens/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ export const generateAccessToken = async (
4444
): Promise<string> => {
4545
const { accessTokenIssuer, alg, accessTokenSignerCallback, tokenExpiresIn, preAuthorizedCode } = opts
4646
const iat = new Date().getTime()
47+
const exp = iat + tokenExpiresIn
4748
const jwt: Jwt = {
4849
header: { typ: 'JWT', alg: alg ?? Alg.ES256K },
4950
payload: {
5051
iat,
51-
exp: tokenExpiresIn,
52+
exp,
5253
iss: accessTokenIssuer,
5354
...(preAuthorizedCode && { preAuthorizedCode }),
5455
},

0 commit comments

Comments
 (0)