twilio / twilio-webchat-react-app

Twilio Webchat React App is an application that demonstrates a website chat widget built with Twilio's Conversations JS SDK, Twilio Paste Design library and Create React App.
MIT License
64 stars 71 forks source link

Add validations to the pre-engagement form, and escape unwanted characters from user input #41

Closed mdeshpande12 closed 1 year ago

mdeshpande12 commented 1 year ago

The Pull Request consists of following changes:

  1. Created custom hook to validate and blacklist unwanted characters so that, scripts or eval functions or console logs cannot be added via user inputs, either from the pre-engagement form or from the chat user input.
  2. Made use of validator.js library to blacklist and escape unwanted characters.
  3. Added HTML based input validation to the "Full Name" form field in the pre-engagement form.
  4. Added unit tests for the useSanitizer custom hook.
  5. Added @testing-library/react-hooks to the dev dependencies for writing unit tests of custom hook.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.