Good day. I'm doing a verification on the authorization form (example):
<input type="email" required/>Nuxt make rendering on the server side. Question: Does it make sense for me to validate the fields of the authorization form on the server side after sending data to the server? Or a second verification is superfluous?
(example on server)
registration.post('/', (req, res) => {
validateInput(req.body).then(({ errors, isValid }) => {
if (isValid) {
User.forge({
username, email
}).save()
.then(user => res.json({ success: true }))
.catch(err => res.status(500).json({ error: err }));
} else {
res.status(400).json(errors);
}
});
});<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c603">#c603</a>)</em></sub></div>