add env var ENABLE_DOMAIN_CHECKER

when using localhost and standalone idhub instance we could avoid this
checker to facilitate testing and deployment
This commit is contained in:
pedro 2025-01-08 22:34:34 +01:00 committed by Cayo Puigdefabregas
parent 77c793b2be
commit 2751b36f8c
2 changed files with 3 additions and 2 deletions

View file

@ -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
)

View file

@ -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='')