login: handle errors