Skip to content

Commit

Permalink
Add logout functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
adomokos committed Sep 1, 2020
1 parent 7e4061a commit d594fe8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions django-mozilla-oidc/src/webapp/templates/webapp/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@
<a class="nav-link" href="/">Home</a>
</li>
{% if request.user.is_authenticated == False %}
<li class="nav-item">
<a class="nav-link" href="{% url 'oidc_authentication_init' %}">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'oidc_authentication_init' %}">Login</a>
</li>
{% endif %}
{% if request.user.is_authenticated == True %}
<li class="nav-item">
<a class="nav-link" href="/profile">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/logout">Log Out</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/profile">Profile</a>
</li>
<li class="nav-item">
<form action="{% url 'oidc_logout' %}" method="post">
{% csrf_token %}
<a class="nav-link" href="#" onclick="this.parentNode.submit();">Logout</a>
</form>
</li>
{% endif %}
</ul>
</div>
Expand Down

0 comments on commit d594fe8

Please sign in to comment.