Skip to content

Commit

Permalink
fix(client): strip unknown data received from webhook (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmasse committed Feb 1, 2022
1 parent bf3c5f5 commit 84a4baa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/client/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ export const Schemas = {
.object({
userId: joi.string().guid().required()
})
.required() as any,
.required()
.options({ stripUnknown: true }) as any,

ConversationStarted: joi
.object({
userId: joi.string().guid().required(),
conversationId: joi.string().guid().required(),
channel: joi.string().required()
})
.required() as any,
.required()
.options({ stripUnknown: true }) as any,

MessageNew: joi
.object({
Expand All @@ -34,5 +36,6 @@ export const Schemas = {
})
.required()
})
.required() as any
.required()
.options({ stripUnknown: true }) as any
}

0 comments on commit 84a4baa

Please sign in to comment.