mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
next try
This commit is contained in:
parent
54258adc42
commit
f133cb15bc
@ -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
|
||||
}
|
||||
|
||||
@ -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=',
|
||||
|
||||
@ -155,6 +155,7 @@ export const queryTransactionLink = gql`
|
||||
amount
|
||||
memo
|
||||
code
|
||||
validUntil
|
||||
senderCommunity {
|
||||
foreign
|
||||
name
|
||||
|
||||
@ -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()
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user