In Drupal 7 I would add a theme process function to add the body classes needed.
function template_preprocess_html(&$variables) {
$variables['classes_array'][] = $variables['is_front'] ? 'front' : 'not-front';
// Add a class that tells us whether the page is viewed by an authenticated user or not.
$variables['classes_array'][] = $variables['logged_in'] ? 'logged-in' : 'not-logged-in';
}
In D8 this theme function exists but they don't have all the variables need for users.