forked from 00dani/lemoncurry
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:
parent
09bf6b8596
commit
d234fd942d
3 changed files with 7 additions and 3 deletions
2
lemonauth/views/__init__.py
Normal file
2
lemonauth/views/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
from .login import login
|
||||||
|
from .logout import logout
|
|
@ -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 otp_agents.forms import OTPAuthenticationForm
|
||||||
from lemoncurry import breadcrumbs
|
from lemoncurry import breadcrumbs
|
||||||
|
|
||||||
breadcrumbs.add(route='lemonauth:login', label='log in', parent='home:index')
|
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,
|
authentication_form=OTPAuthenticationForm,
|
||||||
extra_context={'title': 'log in'},
|
extra_context={'title': 'log in'},
|
||||||
template_name='lemonauth/login.html',
|
template_name='lemonauth/login.html',
|
||||||
redirect_authenticated_user=True,
|
redirect_authenticated_user=True,
|
||||||
)
|
)
|
||||||
logout = auth_views.LogoutView.as_view()
|
|
3
lemonauth/views/logout.py
Normal file
3
lemonauth/views/logout.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import django.contrib.auth.views
|
||||||
|
|
||||||
|
logout = django.contrib.auth.views.LogoutView.as_view()
|
Loading…
Reference in a new issue