mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
parent
83afa74927
commit
f16c8a5444
@ -868,6 +868,8 @@ ACCOUNT_LOGIN_ATTEMPTS_LIMIT = get_setting('INVENTREE_LOGIN_ATTEMPTS', 'login_at
|
|||||||
ACCOUNT_DEFAULT_HTTP_PROTOCOL = get_setting('INVENTREE_LOGIN_DEFAULT_HTTP_PROTOCOL', 'login_default_protocol', 'http')
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL = get_setting('INVENTREE_LOGIN_DEFAULT_HTTP_PROTOCOL', 'login_default_protocol', 'http')
|
||||||
ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
|
ACCOUNT_LOGOUT_ON_PASSWORD_CHANGE = True
|
||||||
ACCOUNT_PREVENT_ENUMERATION = True
|
ACCOUNT_PREVENT_ENUMERATION = True
|
||||||
|
# 2FA
|
||||||
|
REMOVE_SUCCESS_URL = 'settings'
|
||||||
|
|
||||||
# override forms / adapters
|
# override forms / adapters
|
||||||
ACCOUNT_FORMS = {
|
ACCOUNT_FORMS = {
|
||||||
|
@ -38,9 +38,9 @@ from .views import (AboutView, AppearanceSelectView, CustomConnectionsView,
|
|||||||
CustomEmailView, CustomLoginView,
|
CustomEmailView, CustomLoginView,
|
||||||
CustomPasswordResetFromKeyView,
|
CustomPasswordResetFromKeyView,
|
||||||
CustomSessionDeleteOtherView, CustomSessionDeleteView,
|
CustomSessionDeleteOtherView, CustomSessionDeleteView,
|
||||||
CustomTwoFactorRemove, DatabaseStatsView, DynamicJsView,
|
DatabaseStatsView, DynamicJsView, EditUserView, IndexView,
|
||||||
EditUserView, IndexView, NotificationsView, SearchView,
|
NotificationsView, SearchView, SetPasswordView,
|
||||||
SetPasswordView, SettingsView, auth_request)
|
SettingsView, auth_request)
|
||||||
|
|
||||||
admin.site.site_header = "InvenTree Admin"
|
admin.site.site_header = "InvenTree Admin"
|
||||||
|
|
||||||
@ -191,10 +191,6 @@ frontendpatterns = [
|
|||||||
re_path(r'^accounts/social/connections/', CustomConnectionsView.as_view(), name='socialaccount_connections'),
|
re_path(r'^accounts/social/connections/', CustomConnectionsView.as_view(), name='socialaccount_connections'),
|
||||||
re_path(r"^accounts/password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$", CustomPasswordResetFromKeyView.as_view(), name="account_reset_password_from_key"),
|
re_path(r"^accounts/password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$", CustomPasswordResetFromKeyView.as_view(), name="account_reset_password_from_key"),
|
||||||
|
|
||||||
# Temporary fix for django-allauth-2fa # TODO remove
|
|
||||||
# See https://github.com/inventree/InvenTree/security/advisories/GHSA-8j76-mm54-52xq
|
|
||||||
re_path(r'^accounts/two_factor/remove/?$', CustomTwoFactorRemove.as_view(), name='two-factor-remove'),
|
|
||||||
|
|
||||||
# Override login page
|
# Override login page
|
||||||
re_path("accounts/login/", CustomLoginView.as_view(), name="account_login"),
|
re_path("accounts/login/", CustomLoginView.as_view(), name="account_login"),
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ from allauth.account.views import (EmailView, LoginView,
|
|||||||
PasswordResetFromKeyView)
|
PasswordResetFromKeyView)
|
||||||
from allauth.socialaccount.forms import DisconnectForm
|
from allauth.socialaccount.forms import DisconnectForm
|
||||||
from allauth.socialaccount.views import ConnectionsView
|
from allauth.socialaccount.views import ConnectionsView
|
||||||
from allauth_2fa.views import TwoFactorRemove
|
|
||||||
from djmoney.contrib.exchange.models import ExchangeBackend, Rate
|
from djmoney.contrib.exchange.models import ExchangeBackend, Rate
|
||||||
from user_sessions.views import SessionDeleteOtherView, SessionDeleteView
|
from user_sessions.views import SessionDeleteOtherView, SessionDeleteView
|
||||||
|
|
||||||
@ -664,9 +663,3 @@ class NotificationsView(TemplateView):
|
|||||||
"""View for showing notifications."""
|
"""View for showing notifications."""
|
||||||
|
|
||||||
template_name = "InvenTree/notifications/notifications.html"
|
template_name = "InvenTree/notifications/notifications.html"
|
||||||
|
|
||||||
|
|
||||||
# Custom 2FA removal form to allow custom redirect URL
|
|
||||||
class CustomTwoFactorRemove(TwoFactorRemove):
|
|
||||||
"""Specify custom URL redirect."""
|
|
||||||
success_url = reverse_lazy("settings")
|
|
||||||
|
Loading…
Reference in New Issue
Block a user