Skip to content

Commit

Permalink
chore: remove django 2FA
Browse files Browse the repository at this point in the history
Change-Id: I7df148ac911f50519286453ef1ecbc4b5d53086f
  • Loading branch information
Guillaume-sousa committed Apr 17, 2023
1 parent c034cf8 commit 2f25075
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 36 deletions.
8 changes: 0 additions & 8 deletions mdcs/core_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@
""" boolean: enable SAML2 SSO authentication.
"""

ENABLE_2FA = os.getenv("ENABLE_2FA", "False").lower() == "true"
""" :py:class:`bool`: Enable 2 Factor Authentication login
"""

ENABLE_2FA_EMAIL = os.getenv("ENABLE_2FA_EMAIL", "False").lower() == "true"
""" :py:class:`bool`: Enable 2 Factor Authentication login. Ignored if ENABLE_2FA is False.
"""

ENABLE_HANDLE_PID = os.getenv("ENABLE_HANDLE_PID", "False").lower() == "true"
""" boolean: enable handle server PID support.
"""
Expand Down
22 changes: 1 addition & 21 deletions mdcs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,24 +537,4 @@
},
}

# Django two-factor auth
if ENABLE_2FA: # noqa: F405 (core setting)
LOGIN_URL = "two_factor:login"
LOGIN_REDIRECT_URL = "two_factor:profile"

INSTALLED_APPS = INSTALLED_APPS + (
"django_otp",
"django_otp.plugins.otp_static",
"django_otp.plugins.otp_totp",
"two_factor",
"two_factor.plugins.phonenumber",
)
MIDDLEWARE = MIDDLEWARE + ("django_otp.middleware.OTPMiddleware",)

if ENABLE_2FA_EMAIL: # noqa: F405 (core setting)
INSTALLED_APPS = INSTALLED_APPS + (
"django_otp.plugins.otp_email",
"two_factor.plugins.email",
)
else:
LOGIN_URL = "core_main_app_login"
LOGIN_URL = "core_main_app_login"
7 changes: 0 additions & 7 deletions templates/two_factor/_base.html

This file was deleted.

0 comments on commit 2f25075

Please sign in to comment.