supertokens-node icon indicating copy to clipboard operation
supertokens-node copied to clipboard

Make optional form fields by default into empty string, improve error message for missing form fields and return a 400 in case of mismatch of form fields

Open rishabhpoddar opened this issue 3 years ago • 0 comments

If a user marks a form field as optional, right now it means that it must still be part of the request body, but it being an empty string is allowed. This is not very intuitive.

Before validating form fields input length, we should add the missing form fields in the input body and the value of them should be empty strings.

We should also improve the error message returned by mismatch form field config.

Also, we should return a 400 error in case there is a mismatch of frontend and backend form fields. This signifies a coding error and not a user error.

rishabhpoddar avatar May 08 '22 14:05 rishabhpoddar