Adds error handling to login and signup.