This commit is contained in:
clauspeterhuebner 2025-04-24 01:38:44 +02:00
parent 54258adc42
commit f133cb15bc
4 changed files with 8 additions and 5 deletions

View File

@ -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
}

View File

@ -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=',

View File

@ -155,6 +155,7 @@ export const queryTransactionLink = gql`
amount
memo
code
validUntil
senderCommunity {
foreign
name

View File

@ -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()
})