Refactor the login views into their own modules, because I'm about to implement IndieAuth and it's gonna be kinda big

This commit is contained in:
Danielle McLean 2017-10-26 11:21:56 +11:00
parent 09bf6b8596
commit d234fd942d
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
3 changed files with 7 additions and 3 deletions

View file

@ -0,0 +1,2 @@
from .login import login
from .logout import logout

View file

@ -1,13 +1,12 @@
from django.contrib.auth import views as auth_views
import django.contrib.auth.views
from otp_agents.forms import OTPAuthenticationForm
from lemoncurry import breadcrumbs
breadcrumbs.add(route='lemonauth:login', label='log in', parent='home:index')
login = auth_views.LoginView.as_view(
login = django.contrib.auth.views.LoginView.as_view(
authentication_form=OTPAuthenticationForm,
extra_context={'title': 'log in'},
template_name='lemonauth/login.html',
redirect_authenticated_user=True,
)
logout = auth_views.LogoutView.as_view()

View file

@ -0,0 +1,3 @@
import django.contrib.auth.views
logout = django.contrib.auth.views.LogoutView.as_view()