diff --git a/backend/src/graphql/model/DisbursementLink.ts b/backend/src/graphql/model/DisbursementLink.ts index d0c090cd5..e09efb83f 100644 --- a/backend/src/graphql/model/DisbursementLink.ts +++ b/backend/src/graphql/model/DisbursementLink.ts @@ -1,5 +1,5 @@ import { Decimal } from 'decimal.js-light' -import { ObjectType, Field } from 'type-graphql' +import { ObjectType, Field, Int } from 'type-graphql' import { DisbursementJwtPayloadType } from '@/auth/jwt/payloadtypes/DisbursementJwtPayloadType' @@ -27,7 +27,7 @@ export class DisbursementLink { this.memo = disbursementPayload.memo this.code = disbursementPayload.redeemcode if (disbursementPayload.exp) { - this.validUntil = new Date(disbursementPayload.exp) + this.validUntil = disbursementPayload.exp * 1000 } } @@ -52,6 +52,6 @@ export class DisbursementLink { @Field(() => String) code: string - @Field(() => Date) - validUntil: Date + @Field(() => Int) + validUntil: number } diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.ts b/backend/src/graphql/resolver/TransactionLinkResolver.ts index 877946390..33d900ec8 100644 --- a/backend/src/graphql/resolver/TransactionLinkResolver.ts +++ b/backend/src/graphql/resolver/TransactionLinkResolver.ts @@ -507,7 +507,7 @@ export class TransactionLinkResolver { jwtPayload, ) let verifiedPayload: DisbursementJwtPayloadType | null = null - if (jwtPayload != null) { + if (jwtPayload !== null) { if (jwtPayload.exp && new Date(jwtPayload.exp * 1000) < new Date()) { throw new LogError( 'Redeem JWT-Token expired! jwtPayload.exp=', diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 8cf24fc89..5128e2cee 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -155,6 +155,7 @@ export const queryTransactionLink = gql` amount memo code + validUntil senderCommunity { foreign name diff --git a/frontend/src/pages/TransactionLink.vue b/frontend/src/pages/TransactionLink.vue index ae568bc53..4e422a330 100644 --- a/frontend/src/pages/TransactionLink.vue +++ b/frontend/src/pages/TransactionLink.vue @@ -103,6 +103,8 @@ const tokenExpiresInSeconds = computed(() => { }) const validLink = computed(() => { + console.log('TransactionLink.validLink... linkData.value.validUntil=', linkData.value.validUntil) + console.log('TransactionLink.validLink... new Date().getTime()=', new Date().getTime()) return new Date(linkData.value.validUntil) > new Date() })