Skip to content

Commit aa098d1

Browse files
authored
allauth: logout when canceling 2fa (#511)
Closes #501
1 parent 5a60253 commit aa098d1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

readthedocsext/theme/templates/mfa/authenticate.html

+12-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,22 @@
2222
{% csrf_token %}
2323
{{ form|crispy }}
2424
{{ redirect_field }}
25-
2625
<div class="ui stackable relaxed text menu">
27-
<a class="item" href="{% url "account_login" %}">{% trans "Cancel" %}</a>
2826
<div class="right menu">
27+
<button class="ui button" type="submit" form="logout-from-stage">
28+
{% trans "Cancel" %}
29+
</button>
2930
<button class="ui primary button" type="submit">{% trans "Verify" %}</button>
3031
</div>
3132
</div>
3233
</form>
34+
35+
{# We can't have nested forms, so we need to have a separate form for "Cancel" #}
36+
<form id="logout-from-stage"
37+
action="{% url 'account_logout' %}"
38+
method="post">
39+
{% csrf_token %}
40+
<input type="hidden" name="next" value="{% url 'account_login' %}">
41+
</form>
42+
3343
{% endblock content_body %}

0 commit comments

Comments
 (0)