diff --git a/default_settings.py b/default_settings.py index db4bc7b..c1ad6fe 100644 --- a/default_settings.py +++ b/default_settings.py @@ -283,8 +283,8 @@ } FEATURE_FLAGS = { - "oidc": os.environ.get("OIDC_ENABLED", "False") == "False", - "registration": os.environ.get("REGISTRATION_ENABLED", "False") == "False", + "oidc": os.environ.get("OIDC_ENABLED", "False") == "True", + "registration": os.environ.get("REGISTRATION_ENABLED", "True") == "True", } AUTHENTICATION_BACKENDS = ("django.contrib.auth.backends.ModelBackend",) @@ -313,7 +313,7 @@ def discover_endpoints(discovery_url: str) -> dict: def check_oidc() -> bool: - if FEATURE_FLAGS['oidc']: + if not FEATURE_FLAGS['oidc']: return False missing = [] for x in ["OIDC_RP_CLIENT_ID", "ZITADEL_PROJECT", "OIDC_OP_BASE_URL", "OIDC_PRIVATE_KEYFILE"]: diff --git a/oidc.py b/oidc.py index 11d6c0a..acd6567 100644 --- a/oidc.py +++ b/oidc.py @@ -15,7 +15,7 @@ UserModel = get_user_model() def status(request): - return {"OIDC_ENABLED": settings.OIDC_ENABLED} + return {"OIDC_ENABLED": settings.FEATURE_FLAGS["oidc"]} def _updateUser(user, claims):