Skip to content

Commit

Permalink
feat: Check untrusted data
Browse files Browse the repository at this point in the history
Checks for state and inputText
  • Loading branch information
Alex Risch authored and Alex Risch committed Mar 28, 2024
1 parent 714de0f commit 6dc618c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/frames-validator/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ async function checkUntrustedData(
buttonIndex,
opaqueConversationIdentifier,
timestamp,
state,
state = "",
inputText = "",
}: UntrustedData,
actionBody: frames.FrameActionBody,
) {
Expand All @@ -100,4 +101,8 @@ async function checkUntrustedData(
if (actionBody.state !== state) {
throw new Error("Mismatched state")
}

if (actionBody.inputText !== inputText) {
throw new Error("Missing input text")
}
}

0 comments on commit 6dc618c

Please sign in to comment.