File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -230,8 +230,8 @@ export class VcIssuer<DIDDoc extends object> {
230230 credentialDataSupplier ?: CredentialDataSupplier
231231 credentialDataSupplierInput ?: CredentialDataSupplierInput
232232 newCNonce ?: string
233- cNonceExpiresIn ?: number
234- tokenExpiresIn ?: number
233+ cNonceExpiresIn ?: number // expiration duration in seconds
234+ tokenExpiresIn ?: number // expiration duration in seconds
235235 jwtVerifyCallback ?: JWTVerifyCallback < DIDDoc >
236236 credentialSignerCallback ?: CredentialSignerCallback < DIDDoc >
237237 responseCNonce ?: string
@@ -417,7 +417,7 @@ export class VcIssuer<DIDDoc extends object> {
417417 tokenExpiresIn,
418418 } : {
419419 credentialRequest : UniformCredentialRequest
420- tokenExpiresIn : number
420+ tokenExpiresIn : number // expiration duration in seconds
421421 // grants?: Grant,
422422 clientId ?: string
423423 jwtVerifyCallback ?: JWTVerifyCallback < DIDDoc >
@@ -519,7 +519,8 @@ export class VcIssuer<DIDDoc extends object> {
519519 }
520520 if ( ! iat ) {
521521 throw new Error ( IAT_ERROR )
522- } else if ( iat > createdAt + tokenExpiresIn * 1000 ) {
522+ } else if ( iat > ( createdAt / 1000 + tokenExpiresIn ) ) {
523+ // createdAt is in milliseconds whilst iat and tokenExpiresIn are in seconds
523524 throw new Error ( IAT_ERROR )
524525 }
525526 // todo: Add a check of iat against current TS on server with a skew
You can’t perform that action at this time.
0 commit comments