How can check if current user is node author in node template
/**
 * Implements hook_preprocess_HOOK() for node.html.twig.
 */
function mytheme_preprocess_node(&amp;$variables) {
   $uid = \Drupal::currentUser()-&gt;id();
   $author_id = $variables['node']-&gt;getOwner()-&gt;id();
   if ($author_id == $uid) {
     $variables['is_author'] = TRUE;
   }
   else {
     $variables['is_author'] = FALSE;
   }
}