From daacfaf580a5e2add24e34f37deff75bbd179813 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 25 Jun 2024 20:38:38 +0200 Subject: [PATCH] turn off normal allauth urls if CUI is not active --- src/backend/InvenTree/InvenTree/settings.py | 1 + src/backend/InvenTree/InvenTree/urls.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/backend/InvenTree/InvenTree/settings.py b/src/backend/InvenTree/InvenTree/settings.py index 5e8909b8d9..13e4375279 100644 --- a/src/backend/InvenTree/InvenTree/settings.py +++ b/src/backend/InvenTree/InvenTree/settings.py @@ -1184,6 +1184,7 @@ HEADLESS_FRONTEND_URLS = { 'account_reset_password_from_key': 'https://app.org/account/password/reset/key/{key}', 'account_signup': 'https://app.org/account/signup', } +HEADLESS_ONLY = not ENABLE_CLASSIC_FRONTEND # Markdownify configuration # Ref: https://django-markdownify.readthedocs.io/en/latest/settings.html diff --git a/src/backend/InvenTree/InvenTree/urls.py b/src/backend/InvenTree/InvenTree/urls.py index accca0a7e1..99b9814d99 100644 --- a/src/backend/InvenTree/InvenTree/urls.py +++ b/src/backend/InvenTree/InvenTree/urls.py @@ -370,7 +370,6 @@ classic_frontendpatterns = [ ), # Override login page path('accounts/login/', CustomLoginView.as_view(), name='account_login'), - path('accounts/', include('allauth.urls')), # included urlpatterns ] urlpatterns = [] @@ -392,6 +391,12 @@ frontendpatterns = [] if settings.ENABLE_CLASSIC_FRONTEND: frontendpatterns += classic_frontendpatterns + +# Add auth +frontendpatterns += [ + path('accounts/', include('allauth.urls')) # Always needed as we need providers +] + if settings.ENABLE_PLATFORM_FRONTEND: frontendpatterns += platform_urls if not settings.ENABLE_CLASSIC_FRONTEND: