feat(SW-2605): confirmation page only valid for 1 minute for the session
This commit is contained in:
@@ -4,6 +4,8 @@ import { getMembershipNumber } from "@/server/routers/user/utils"
|
||||
import { createCounter } from "@/server/telemetry"
|
||||
import { router, safeProtectedServiceProcedure } from "@/server/trpc"
|
||||
|
||||
import { encrypt } from "@/utils/encryption"
|
||||
|
||||
import {
|
||||
addPackageInput,
|
||||
cancelBookingsInput,
|
||||
@@ -71,7 +73,12 @@ export const bookingMutationRouter = router({
|
||||
|
||||
metricsCreateBooking.success()
|
||||
|
||||
return verifiedData.data
|
||||
const expire = Math.floor(Date.now() / 1000) + 60 // 1 minute expiry
|
||||
|
||||
return {
|
||||
booking: verifiedData.data,
|
||||
sig: encrypt(expire.toString()),
|
||||
}
|
||||
}),
|
||||
priceChange: safeProtectedServiceProcedure
|
||||
.concat(refIdPlugin.toConfirmationNumber)
|
||||
|
||||
@@ -244,7 +244,12 @@ export const bookingQueryRouter = router({
|
||||
|
||||
metricsGetBookingStatus.success()
|
||||
|
||||
return verifiedData.data
|
||||
const expire = Math.floor(Date.now() / 1000) + 60 // 1 minute expiry
|
||||
|
||||
return {
|
||||
booking: verifiedData.data,
|
||||
sig: encrypt(expire.toString()),
|
||||
}
|
||||
}),
|
||||
createRefId: serviceProcedure
|
||||
.input(createRefIdInput)
|
||||
|
||||
Reference in New Issue
Block a user