How to replace the button when the user is not authenticated? I copied the twig file of my nodes into my theme.

On my nodes there is a flag displayed, but only authenticated users can see it.

Here is my code :

&lt;div class="bs-field-like-link"&gt;
  {{ content.flag_like_group }}
&lt;/div&gt;


How to replace the flag for unauthenticated users by :

&lt;div class="bs-field-like-link"&gt;
  &lt;a class="btn btn-success" href="/user/login"&gt;&lt;i class="far fa-heart fa-1x"&gt;&lt;/i&gt; J'aime&lt;/a&gt;
&lt;/div&gt;
You can use predefined logged_in variable.

{% if logged_in %}
  &lt;div class="bs-field-like-link"&gt;
    {{ content.flag_like_group }}
  &lt;/div&gt;
{% else %}
  &lt;div class="bs-field-like-link"&gt;
    &lt;a class="btn btn-success" href="/user/login"&gt;&lt;i class="far fa-heart fa-1x"&gt;&lt;/i&gt; J'aime&lt;/a&gt;
  &lt;/div&gt;
{% endif %}