Skip to content

Commit

Permalink
Merge pull request #104 from TimoGlastra/fix/seconds-to-ms
Browse files Browse the repository at this point in the history
fix: seconds to ms
  • Loading branch information
nklomp authored Apr 24, 2024
2 parents dc056b9 + cbd60a6 commit a453002
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/issuer/lib/VcIssuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export class VcIssuer<DIDDoc extends object> {
}
if (!iat) {
throw new Error(IAT_ERROR)
} else if (iat > createdAt + tokenExpiresIn) {
} else if (iat > createdAt + tokenExpiresIn * 1000) {
throw new Error(IAT_ERROR)
}
// todo: Add a check of iat against current TS on server with a skew
Expand Down
4 changes: 2 additions & 2 deletions packages/issuer/lib/functions/CredentialOfferUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ export function createCredentialOfferURI(
return createCredentialOfferURIFromObject(credentialOffer, opts)
}

export const isPreAuthorizedCodeExpired = (state: CredentialOfferSession, expirationDuration: number) => {
export const isPreAuthorizedCodeExpired = (state: CredentialOfferSession, expirationDurationInSeconds: number) => {
const now = +new Date()
const expirationTime = state.createdAt + expirationDuration
const expirationTime = state.createdAt + expirationDurationInSeconds * 1000
return now >= expirationTime
}

Expand Down

0 comments on commit a453002

Please sign in to comment.