Add TOTP support with django-otp

This commit is contained in:
Danielle McLean 2017-10-25 01:25:03 +11:00
parent 492ba744fc
commit 3f3bb05a25
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
5 changed files with 27 additions and 1 deletions

View file

@ -30,6 +30,7 @@
<div class="card-body">
{% form_field form.username %}
{% form_field form.password %}
{% form_field form.otp_token %}
</div>
<div class="card-footer">

View file

@ -1,9 +1,11 @@
from django.contrib.auth import views as auth_views
from django_otp.forms import OTPAuthenticationForm
from lemoncurry import breadcrumbs
breadcrumbs.add(route='lemonauth:login', label='log in', parent='home:index')
login = auth_views.LoginView.as_view(
authentication_form=OTPAuthenticationForm,
template_name='lemonauth/login.html',
redirect_authenticated_user=True,
)