Add frontend validation to register and login pages