Skip to content

Commit

Permalink
fix: Expiration Date
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Apr 16, 2020
1 parent a9ded54 commit c7212f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/daf-w3c/src/action-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const transformCredentialInput = (input: CredentialInput): VerifiableCredentialP
}

if (input.expirationDate) {
result['exp'] = new Date(input.expirationDate).getUTCSeconds()
result['exp'] = Date.parse(input.expirationDate) / 1000
}

if (input.id) {
Expand All @@ -147,7 +147,7 @@ const transformPresentationInput = (input: PresentationInput): PresentationPaylo
}

if (input.expirationDate) {
result['exp'] = new Date(input.expirationDate).getUTCSeconds()
result['exp'] = Date.parse(input.expirationDate) / 1000
}

if (input.id) {
Expand Down
2 changes: 2 additions & 0 deletions packages/daf-w3c/src/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const typeDefs = `
input SignCredentialInput {
id: String
expirationDate: Date
issuer: String!
context: [String]!
type: [String]!
Expand All @@ -59,6 +60,7 @@ export const typeDefs = `
input SignPresentationInput {
id: String
expirationDate: Date
tag: String
issuer: String!
audience: String!
Expand Down

0 comments on commit c7212f9

Please sign in to comment.