diff --git a/idhub/mixins.py b/idhub/mixins.py index 055f867..ab7cafa 100644 --- a/idhub/mixins.py +++ b/idhub/mixins.py @@ -33,7 +33,7 @@ class UserView(LoginRequiredMixin): ] def get(self, request, *args, **kwargs): - if not settings.DEVELOPMENT: + if settings.ENABLE_DOMAIN_CHECKER: err_txt = "User domain is {} which does not match server domain {}".format( request.get_host(), settings.DOMAIN ) @@ -56,7 +56,7 @@ class UserView(LoginRequiredMixin): return url or response def post(self, request, *args, **kwargs): - if not settings.DEVELOPMENT: + if settings.ENABLE_DOMAIN_CHECKER: err_txt = "User domain is {} which does not match server domain {}".format( request.get_host(), settings.DOMAIN ) diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index 7610a49..01da39c 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -241,5 +241,6 @@ OIDC_ORGS = config('OIDC_ORGS', '') ENABLE_EMAIL = config('ENABLE_EMAIL', default=True, cast=bool) CREATE_TEST_USERS = config('CREATE_TEST_USERS', default=False, cast=bool) ENABLE_2FACTOR_AUTH = config('ENABLE_2FACTOR_AUTH', default=True, cast=bool) +ENABLE_DOMAIN_CHECKER = config('ENABLE_DOMAIN_CHECKER', default=True, cast=bool) COMMIT = config('COMMIT', default='')