auth: add better front-end validation and error handling