Add Twitch auth with django-allauth
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
{% load socialaccount %}
|
||||
<header class="d-flex justify-content-between align-items-center py-3 border-bottom">
|
||||
<h1 class="h2">
|
||||
<a href='{% url "index" %}' class="text-decoration-none nav-title">Twitch drops</a>
|
||||
@ -16,6 +17,18 @@
|
||||
<li class="nav-item d-none d-sm-block">
|
||||
<a class="nav-link" href="https://github.com/sponsors/TheLovinator1">Donate</a>
|
||||
</li>
|
||||
{% if not user.is_authenticated %}
|
||||
<li>
|
||||
<a class="nav-link" href="{% provider_login_url 'twitch' %}">Login with Twitch</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<form action="{% url 'account_logout' %}" method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-link nav-link">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
Reference in New Issue
Block a user