Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

React – is it more secure if you validate forms on client or server?

In react, is it better to have form validation checks such as if email is proper or not on client or on server? Wouldn’t it be more faster on client, but less secure. For example, let’s say you have a login form with react. In the login form, you could have two fields: an email field and a password field. Let’s also say you wanted to check if the email was a valid email. Would it be more efficient and secure to do this check on the server and make the server reply to the client or the client just handles all kind of checks like that. Or perhaps would it be best to do the checks on both client and server?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

As far as validations are concerned, it is always advisable that they are carried out both on the client and on the server as the APIs are public, therefore anyone can make calls. As far as the client is concerned, it is correct to add validations to avoid overloading the server with useless calls and to reduce traffic. The thing I recommend is to have an API to retrieve the validation regexes and then use them both on the client and on the server.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading