add logout button if logged in

This commit is contained in:
Jannis Portmann 2021-05-13 16:48:27 +02:00
parent 428baa749c
commit cf60740251

View file

@ -55,8 +55,12 @@
</li>
</ul>
<span>
<a type="button" class="btn btn-light" href="{{ path('app_login') }}">Log in</a>
</span>
{% if is_granted('ROLE_USER') %}
<a type="button" class="btn btn-light" href="{{ path('app_logout') }}">Log out</a>
{% else %}
<a type="button" class="btn btn-light" href="{{ path('app_login') }}">Log in</a>
{% endif %}
</span>
</div>
</nav>