-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Welcome to the FormTribe
This issue will get you the points mentioned in issue title for the FormTribe Hackathon
Preparation:
If this is your first time contributing, please read:
- Our introductory blog post
- Overview of Code Guidelines at Formbricks.
Only when your PR follows all of the best practices it will get merged.
Want more points quick? Complete Side Quests 🏰
Is your feature request related to a problem? Please describe.
Some users want to protect their survey with a code
Describe the solution you'd like
Enable protected surveys:
Tasks
- Add a new setting to the Response Options card, which is only visible if surveyType = link:
Name: Protect survey with a PIN
Subheadline: Only users who have the PIN can access the survey
-
Validate that only numbers are added and not more than 4. You can validate on blur and if it doesnt match, delete the input and display a Toast with the following error message "Please set four numbers as PIN"
-
Create the needed UI and import it to the LinkSurvey.tsx. The mockup above is from our upcoming UI revamp and only meant as guidance. No need to build it 1:1
-
Build the logic needed to load the survey only in case the PIN was correct. The PIN does not help a lot if the survey object is completely loaded in the client before the PIN was entered 😃
Technical Challenge
Consult with chatGPT on how to implement this best. You have to find a way to check the PIN without previously exposing it in the public survey object. If you have questions, please reach out in our Discord!