Skip to content

Fix logout logic to use POST (Django 4.1+) #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion en/authentication_authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,17 @@ Let's add some sugar to our templates while we're at it. First we will add some
{% include './icons/file-earmark-plus.svg' %}
</a>
<a href="{% url 'post_draft_list' %}" class="top-menu">{% include './icons/pencil-square.svg'%}</a>
<p id="logout" class="top-menu">Hello {{ user.username }} <small><a href="{% url 'logout' %}">(Log out)</a></small></p>
<p id="logout" class="top-menu">
Hello {{ user.username }}
<small>
(<form method="POST" action="{% url 'logout' %}" style="display:inline;">
{% csrf_token %}
<button type="submit" style="padding:0; border:none; background:none; color:#337ab7; text-decoration:underline; cursor:pointer;">
Log out
</button>
</form>)
</small>
</p>
{% else %}
<a href="{% url 'login' %}" class="top-menu">{% include './icons/lock-fill.svg' %}</a>
{% endif %}
Expand Down
12 changes: 11 additions & 1 deletion es/authentication_authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ Vamos a agregarle algo de dulce a nuestras plantillas mientras estamos ahΓ­. Pri
{% if user.is_authenticated %}
<a href="{% url 'post_new' %}" class="top-menu"><span class="glyphicon glyphicon-plus"></span></a>
<a href="{% url 'post_draft_list' %}" class="top-menu"><span class="glyphicon glyphicon-edit"></span></a>
<p class="top-menu">Hello {{ user.username }} <small>(<a href="{% url 'logout' %}">Log out</a>)</small></p>
<p id="logout" class="top-menu">
Hello {{ user.username }}
<small>
(<form method="POST" action="{% url 'logout' %}" style="display:inline;">
{% csrf_token %}
<button type="submit" style="padding:0; border:none; background:none; color:#337ab7; text-decoration:underline; cursor:pointer;">
Log out
</button>
</form>)
</small>
</p>
{% else %}
<a href="{% url 'login' %}" class="top-menu"><span class="glyphicon glyphicon-lock"></span></a>
{% endif %}
Expand Down
12 changes: 11 additions & 1 deletion fa/authentication_authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,17 @@ LOGIN_REDIRECT_URL = '/'
{% if user.is_authenticated %}
<a href="{% url 'post_new' %}" class="top-menu"><span class="glyphicon glyphicon-plus"></span></a>
<a href="{% url 'post_draft_list' %}" class="top-menu"><span class="glyphicon glyphicon-edit"></span></a>
<p class="top-menu">Hello {{ user.username }} <small>(<a href="{% url 'logout' %}">Log out</a>)</small></p>
<p id="logout" class="top-menu">
Hello {{ user.username }}
<small>
(<form method="POST" action="{% url 'logout' %}" style="display:inline;">
{% csrf_token %}
<button type="submit" style="padding:0; border:none; background:none; color:#337ab7; text-decoration:underline; cursor:pointer;">
Log out
</button>
</form>)
</small>
</p>
{% else %}
<a href="{% url 'login' %}" class="top-menu"><span class="glyphicon glyphicon-lock"></span></a>
{% endif %}
Expand Down
12 changes: 11 additions & 1 deletion ja/authentication_authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ LOGIN_REDIRECT_URL = '/'
{% if user.is_authenticated %}
<a href="{% url 'post_new' %}" class="top-menu"><span class="glyphicon glyphicon-plus"></span></a>
<a href="{% url 'post_draft_list' %}" class="top-menu"><span class="glyphicon glyphicon-edit"></span></a>
<p class="top-menu">Hello {{ user.username }} <small>(<a href="{% url 'logout' %}">Log out</a>)</small></p>
<p id="logout" class="top-menu">
Hello {{ user.username }}
<small>
(<form method="POST" action="{% url 'logout' %}" style="display:inline;">
{% csrf_token %}
<button type="submit" style="padding:0; border:none; background:none; color:#337ab7; text-decoration:underline; cursor:pointer;">
Log out
</button>
</form>)
</small>
</p>
{% else %}
<a href="{% url 'login' %}" class="top-menu"><span class="glyphicon glyphicon-lock"></span></a>
{% endif %}
Expand Down
12 changes: 11 additions & 1 deletion ko/authentication_authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ LOGIN_REDIRECT_URL = '/'
{% if user.is_authenticated %}
<a href="{% url 'post_new' %}" class="top-menu"><span class="glyphicon glyphicon-plus"></span></a>
<a href="{% url 'post_draft_list' %}" class="top-menu"><span class="glyphicon glyphicon-edit"></span></a>
<p class="top-menu">Hello {{ user.username }} <small>(<a href="{% url 'logout' %}">Log out</a>)</small></p>
<p id="logout" class="top-menu">
Hello {{ user.username }}
<small>
(<form method="POST" action="{% url 'logout' %}" style="display:inline;">
{% csrf_token %}
<button type="submit" style="padding:0; border:none; background:none; color:#337ab7; text-decoration:underline; cursor:pointer;">
Log out
</button>
</form>)
</small>
</p>
{% else %}
<a href="{% url 'login' %}" class="top-menu"><span class="glyphicon glyphicon-lock"></span></a>
{% endif %}
Expand Down