requiresLogin now returns 401 Unauthorized to AJAX clients