From 79dc6c122bb8f58e6f8e05aad03855799da750d2 Mon Sep 17 00:00:00 2001 From: Anthoni Gleeson Date: Tue, 13 Aug 2024 17:06:40 +0100 Subject: [PATCH 1/2] remove hard coding of user model --- django_app/redbox_app/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_app/redbox_app/settings.py b/django_app/redbox_app/settings.py index f31b2fd33..38e57e2e8 100644 --- a/django_app/redbox_app/settings.py +++ b/django_app/redbox_app/settings.py @@ -70,11 +70,12 @@ "import_export", ] -AUTH_USER_MODEL = "redbox_core.User" if LOGIN_METHOD == "sso": INSTALLED_APPS.append("authbroker_client") AUTH_USER_MODEL = "redbox_core.SSOUser" +else: + AUTH_USER_MODEL = "redbox_core.User" MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", @@ -153,7 +154,6 @@ USE_TZ = True DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" SITE_ID = 1 -AUTH_USER_MODEL = "redbox_core.User" ACCOUNT_EMAIL_VERIFICATION = "none" # CSP settings https://content-security-policy.com/ From eb1e1261fa930dce3c7b70261b10e53cb8c57749 Mon Sep 17 00:00:00 2001 From: Anthoni Gleeson Date: Tue, 13 Aug 2024 17:08:13 +0100 Subject: [PATCH 2/2] default login method to magic link --- django_app/redbox_app/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_app/redbox_app/settings.py b/django_app/redbox_app/settings.py index 38e57e2e8..0bb838aa7 100644 --- a/django_app/redbox_app/settings.py +++ b/django_app/redbox_app/settings.py @@ -19,7 +19,7 @@ SECRET_KEY = env.str("DJANGO_SECRET_KEY") ENVIRONMENT = Environment[env.str("ENVIRONMENT").upper()] WEBSOCKET_SCHEME = "ws" if ENVIRONMENT.is_test else "wss" -LOGIN_METHOD = env.str("LOGIN_METHOD") +LOGIN_METHOD = env.str("LOGIN_METHOD", "magic_link") if env.str("HOSTS", ""): env_hosts = env.str("HOSTS", "").split(",")