Handle 401 and login errors