Browse Source

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

pull/1/head
Danielle McLean 4 years ago
parent
commit
d234fd942d
Signed by: 00dani GPG Key ID: 5A5D2D1AFF12EEC5
  1. 2
      lemonauth/views/__init__.py
  2. 5
      lemonauth/views/login.py
  3. 3
      lemonauth/views/logout.py

2
lemonauth/views/__init__.py

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

5
lemonauth/views.py → lemonauth/views/login.py

@ -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()

3
lemonauth/views/logout.py

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