Skip to content

Commit 0e189f0

Browse files
committed
Remove user_needs_to_verify_otp util, just always show the logout button
1 parent cf6460b commit 0e189f0

File tree

3 files changed

+3
-35
lines changed

3 files changed

+3
-35
lines changed

packages/hidp/hidp/otp/utils.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/hidp/hidp/otp/views.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
reset_static_tokens,
2828
)
2929
from hidp.otp.forms import OTPSetupForm, VerifyStaticTokenForm, VerifyTOTPForm
30-
from hidp.otp.utils import user_needs_to_verify_otp
3130
from hidp.rate_limit.decorators import rate_limit_default
3231

3332
from .decorators import otp_exempt
@@ -214,9 +213,7 @@ def get_context_data(self, **kwargs):
214213
self.backup_device.token_set.values_list("token", flat=True)
215214
),
216215
"back_url": reverse("hidp_otp_management:manage"),
217-
"logout_url": reverse("hidp_accounts:logout")
218-
if user_needs_to_verify_otp(self.request.user)
219-
else None,
216+
"logout_url": reverse("hidp_accounts:logout"),
220217
}
221218

222219
def form_valid(self, form):

packages/hidp/hidp/templates/hidp/otp/setup_device.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ <h2>{% translate 'Recovery codes' %}</h2>
6969
{% include 'hidp/includes/forms/submit_row.html' with submit_label=_('Submit') %}
7070
</form>
7171

72-
{% if logout_url %}
73-
{% include 'hidp/includes/forms/logout_form.html' %}
74-
{% elif back_url %}
75-
<a href="{{ back_url }}">{% translate 'Back' %}</a>
76-
{% endif %}
72+
{% include 'hidp/includes/forms/logout_form.html' %}
73+
<a href="{{ back_url }}">{% translate 'Back' %}</a>
7774
{% endblock %}

0 commit comments

Comments
 (0)