const schema = Schema.Struct({
duration: Schema.DurationFromSelf,
token: Schema.transformOrFail(
Schema.Struct({..}),
Schema.String,
{
strict: true,
encode: (...) => { /* decrypt token and get the data or return error */ },
decode: (...) => { /* encrypt token with 'duration' value and return the encrypted string or return error in case of any failure */ }
)
})
const schema = Schema.Struct({
duration: Schema.DurationFromSelf,
token: Schema.transformOrFail(
Schema.Struct({..}),
Schema.String,
{
strict: true,
encode: (...) => { /* decrypt token and get the data or return error */ },
decode: (...) => { /* encrypt token with 'duration' value and return the encrypted string or return error in case of any failure */ }
)
})