vijaygill / wg-ui-plus

Wireguard VPN + Management Web-UI with fine-grained control over access.
MIT License
2 stars 0 forks source link

Apply validation to data entered. #11

Closed vijaygill closed 5 months ago

vijaygill commented 5 months ago

Currently there is no data validation.

thecoshman commented 5 months ago

I'm sure I'm stating obvious, but validation HAS to be done server side, but client side can be used to help reduce stupid server requests. I wonder though if to avoid implementing things twice.. the validation can always be done server side, and the UI makes a kinda of 'validation' call every time you enter data. That way, the UI can provide validation/feedback to the Users as they enter data, but we don't have to keep two versions of validation in sync. Would also mean that the server could do validation on more than just single field.

vijaygill commented 5 months ago

@thecoshman - validation will be done only at the server side. The application is not a very busy one, so we can live with all the calls to server.

thecoshman commented 5 months ago

Wonder if we can use some sort of structured way of returning validation errors? Like a map of form fields to error messages 🤔

vijaygill commented 5 months ago

Wonder if we can use some sort of structured way of returning validation errors? Like a map of form fields to error messages 🤔

That I am working on. The client gets business rules violations and displays them on the screen.