Login and Logout Links on the condition of user logged in. - Twig Drupal 9

 

The code in my template file. (Page.html.twig)

<div class="login-logout">
{% if logged_in %}
{{ link('Logout', 'route:user.logout') }}
  {% else %}
 {{ link('Login', 'route:user.login') }}
  {% endif %}
  </div>

 

My css to make my link display where and how I want it

.login-logout a {
  font-size: 18px;
  line-height: 25px;
  font-family: 'acumin-pro-semi-condensed';
  font-weight: 600;
  color: #033558;
  position: absolute;
  right: 300px;
  top: 150px;
  color: #fff;
}

 

laugh