mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
sso: Add django-axes to project
Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
8b5f3576ee
commit
31cd97e71e
@ -214,7 +214,8 @@ def configure_django():
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.messages',
|
||||
'stronghold',
|
||||
'plinth']
|
||||
'plinth',
|
||||
'axes']
|
||||
applications += module_loader.get_modules_to_load()
|
||||
sessions_directory = os.path.join(cfg.data_dir, 'sessions')
|
||||
|
||||
|
||||
@ -20,12 +20,14 @@ URLs for the Users module
|
||||
|
||||
from django.conf.urls import url
|
||||
from django.urls import reverse_lazy
|
||||
from stronghold.decorators import public
|
||||
|
||||
from stronghold.decorators import public
|
||||
from plinth.utils import non_admin_view
|
||||
from plinth.modules.sso.views import SSOLoginView, SSOLogoutView, CaptchaLoginView
|
||||
from . import views
|
||||
|
||||
from axes.decorators import watch_login
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^sys/users/$', views.UserList.as_view(), name='index'),
|
||||
url(r'^sys/users/create/$', views.UserCreate.as_view(), name='create'),
|
||||
@ -38,8 +40,11 @@ urlpatterns = [
|
||||
url(r'^sys/users/(?P<slug>[\w.@+-]+)/change_password/$',
|
||||
non_admin_view(views.UserChangePassword.as_view()),
|
||||
name='change_password'),
|
||||
# Add Django's login/logout urls
|
||||
url(r'^accounts/login/$', public(SSOLoginView.as_view()), name='login'),
|
||||
|
||||
# Authnz is handled by SSO
|
||||
url(r'^accounts/login/$',
|
||||
public(watch_login(SSOLoginView.as_view())),
|
||||
name='login'),
|
||||
url(r'^accounts/logout/$',
|
||||
non_admin_view(SSOLogoutView.as_view()),
|
||||
{'next_page': reverse_lazy('index')},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user