Add login/register/logout button

This commit is contained in:
Tim 2022-01-01 23:36:26 +01:00
parent 94ff83d89a
commit 60577f15fe

View File

@ -8,12 +8,26 @@
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
<a class="nav-link active" href="{{ path('home') }}">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ path('admin') }}">Admin</a>
</li>
</ul>
<ul class="navbar-nav ms-auto mb-2 mb-md-0">
{% if is_granted('ROLE_USER') %}
<li class="nav-item">
<a class="nav-link active" href="{{ path('logout') }}">Logout</a>
</li>
{% else %}
<li class="nav-item">
<a class="nav-link active" href="{{ path('login') }}">Login</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="{{ path('register') }}">Register</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
</nav>