Skip to content

Commit d57b9c2

Browse files
Add logout form
1 parent f0dd9d7 commit d57b9c2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% load i18n %}
2+
3+
{% comment %}
4+
The logout_url is required for the form action. It is passed in from the view
5+
that renders this template. If the logout_url is not provided, the form will
6+
submit to the current URL, which may not be the intended behavior.
7+
{% endcomment %}
8+
9+
{% if logout_url %}
10+
<form action="{{ logout_url }}" method="post">
11+
{% csrf_token %}
12+
<input class="secondary" type="submit" value="{{ logout_label|default:_("Sign out") }}" />
13+
</form>
14+
{% endif %}

0 commit comments

Comments
 (0)