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> </li>
</ul> </ul>
<span> <span>
<a type="button" class="btn btn-light" href="{{ path('app_login') }}">Log in</a> {% if is_granted('ROLE_USER') %}
</span> <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> </div>
</nav> </nav>