Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
What is stopping somebody from submitting a form with JavaScript in the console?

In the SDK tutorials, the JavaScript code shows forms being submitted with submitForm(). There are some examples of basic input validation such as making sure a user does not input some invalid or even harmful values. If a user's input is not invalid, as the tutorials show, submitForm() is called.

My question is what is preventing a user from using the JavaScript console to run submitForm() regardless of what parameters are put on the input fields? For example, suppose a user must input a SAC that was sent to their phone for submitForm() to be called. What is preventing them from just running submitForm() in the console?

Thank you.

Votes Newest

Answers


Hello,

Nothing is stopping users from calling submitForm() in the browser, in fact their is nothing keeping the user from running whatever html, css, or javascript on any webpage whether that be online banking or google.com. This is why in the SDK documentation Q2 recommends that developers do python(server-side) validation on the input also.

-Trey

Posted 3 years ago
Trey Teter
124 × 2 Administrator
0

Thank you for the info. In the tutorials shown on server-side validation, they mainly center around a user pressing a button to execute submitForm() and denying this button from calling the function. What I don't see is how a user cannot circumvent all of the validation done in the tutorials by running submitForm() in the console. I think the core of my question is this: if we have to provide the next route as a routing_key in get_tecton_form(), how can we use Q2's tech to prevent a user from just using submitForm() to proceed to that specified route? Can we force a different route?

— Ethan Pittman   3 years ago
1

On that specific destination route you need to check the data and make sure it is what you are expecting, sure you can force a different route. If it is in the same extension.py you can just do return route_function_name() server side validation is mentioned, how to do it doesn't seem to be shown.

— Trey Teter   3 years ago