Automatically redirect to login page when authentication errors happen during AJAX call