Handle auth errors properly fixes #159