SloveniaEngineering / laguna-frontend

Laguna frontend source tree
Apache License 2.0
3 stars 1 forks source link

Should validation be on FE? #28

Closed kenpaicat closed 10 months ago

kenpaicat commented 11 months ago

Description

Feels wrong to do validation on two different places. cc @amadejzr @zigapovhe @anzbez

zigapovhe commented 11 months ago

If validation rules are the same, I don't see a problem with having validation both on FE and BE. Why I think validation should be on FE:

Why I think having validation on BE is still a good idea:

anzbez commented 11 months ago

Generally I agree with @zigapovhe, but a few notes:

kenpaicat commented 10 months ago

82436b5094b39622017a02e9f7ecf8ea636d3f2d reduces password constraints on FE because backend doesn't enforce them. Backend checks for length and non-control-char.

Validation will be favored on BE since Error messages are coming from BE, but some validation (to prevent common mistakes and thus burdening BE with them) can be enforced on FE (such as PWD length).