Skip to content

Commit

Permalink
fix: seconds to ms
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Mar 17, 2024
1 parent fcaff29 commit cbd60a6
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 cbd60a6

Please sign in to comment.