Skip to content

Commit

Permalink
Merge pull request #48 from uktrade/fix/sso-integration
Browse files Browse the repository at this point in the history
remove hard coding of user model
  • Loading branch information
a-gleeson authored Aug 13, 2024
2 parents e1e80e2 + eb1e126 commit 9d62a56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django_app/redbox_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(",")
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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/
Expand Down

0 comments on commit 9d62a56

Please sign in to comment.