diff --git a/doc/configuration.rst b/doc/configuration.rst index ee4368555..2caff6679 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -204,19 +204,6 @@ relative URL of your logo under ``MEDIA_URL``. For example:: Then copy your logo file into the directory indicated by ``MEDIA_ROOT``. -Custom new admin sub-url -======================== - -You can edit the new admin sub-url (by default it is `/new-admin`). - -To do so, open the :file:`settings.py` file and add (or uncomment) -``NEW_ADMIN_URL`` variable. This variable must contain a relative url -without initial and last `'/'`. For example:: - - NEW_ADMIN_URL = 'test_admin' - -You will need to change you web server accordingly and rebuild the frontend. - ****************** Host configuration ****************** diff --git a/doc/upgrade.rst b/doc/upgrade.rst index 385e13315..7fd92a357 100644 --- a/doc/upgrade.rst +++ b/doc/upgrade.rst @@ -194,6 +194,7 @@ Required changes to :file:`settings.py` 'modoboa.lib.middleware.RequestCatcherMiddleware', ) +- Remove ``NEW_ADMIN_URL`` variable Version 2.3.3 diff --git a/modoboa/core/commands/templates/settings.py.tpl b/modoboa/core/commands/templates/settings.py.tpl index 90b3b6fe6..a0670515c 100644 --- a/modoboa/core/commands/templates/settings.py.tpl +++ b/modoboa/core/commands/templates/settings.py.tpl @@ -234,9 +234,6 @@ REST_FRAMEWORK = { } -# Uncomment if you need a custom sub url for new_admin interface -# NEW_ADMIN_URL = 'new-admin' - SPECTACULAR_SETTINGS = { 'SCHEMA_PATH_PREFIX': r'/api/v[0-9]', 'TITLE': 'Modoboa API', diff --git a/modoboa/core/management/commands/load_initial_data.py b/modoboa/core/management/commands/load_initial_data.py index 1fa35758a..41a94badd 100644 --- a/modoboa/core/management/commands/load_initial_data.py +++ b/modoboa/core/management/commands/load_initial_data.py @@ -113,8 +113,7 @@ class Command(BaseCommand): if not allowed_host: allowed_host = "localhost" frontend_application = app_model.objects.filter(name="modoboa_frontend") - frontend_path = getattr(settings, "NEW_ADMIN_URL", "new-admin") - base_uri = f"https://{allowed_host}/{frontend_path}" + base_uri = f"https://{allowed_host}" redirect_uri = f"{base_uri}/login/logged" client_id = "" if not frontend_application.exists(): @@ -136,7 +135,11 @@ class Command(BaseCommand): "authorization-code", ) else: - client_id = frontend_application.first().client_id + app = frontend_application.first() + app.redirect_uris = redirect_uri + app.post_logout_redirect_urls = base_uri + app.save() + client_id = app.client_id base_frontend_dir = os.path.join( os.path.dirname(__file__), "../../../frontend_dist/" diff --git a/test_project/test_project/settings.py b/test_project/test_project/settings.py index ab39e08b0..fe6ba6b42 100644 --- a/test_project/test_project/settings.py +++ b/test_project/test_project/settings.py @@ -246,9 +246,6 @@ REST_FRAMEWORK = { "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", } -# Uncomment if you need a custom sub url for new_admin interface -# NEW_ADMIN_URL = 'new-admin' - SPECTACULAR_SETTINGS = { "SCHEMA_PATH_PREFIX": r"/api/v[0-9]", "TITLE": "Modoboa API",