Skip to content
Snippets Groups Projects
Verified Commit 02bf849e authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add optional support for SMS and phone calls using Twilio.

parent f56910ae
No related branches found
No related tags found
1 merge request!59Resolve "2FA"
......@@ -324,4 +324,12 @@ CRON_CLASSES = [
ANONYMIZE_ENABLED = _settings.get('maintenance.anonymisable', True)
if _settings.get('2fa.twilio.sid', None):
MIDDLEWARE.insert(MIDDLEWARE.index('django_otp.middleware.OTPMiddleware')+1, 'two_factor.middleware.threadlocals.ThreadLocals')
TWILIO_SID = _settings.get('2fa.twilio.sid')
TWILIO_TOKEN = _settings.get('2fa.twilio.token')
TWILIO_CALLER_ID = _settings.get('2fa.twilio.callerid')
TWO_FACTOR_CALL_GATEWAY = 'two_factor.gateways.twilio.gateway.Twilio'
TWO_FACTOR_SMS_GATEWAY = 'two_factor.gateways.twilio.gateway.Twilio'
_settings.populate_obj(sys.modules[__name__])
......@@ -38,6 +38,11 @@ urlpatterns = [
path('', include(tf_urls))
]
# Add URLs for optional features
if hasattr(settings, 'TWILIO_ACCOUNT_SID'):
from two_factor.gateways.twilio.urls import urlpatterns as tf_twilio_urls # noqa
urlpatterns += [path('', include(tf_twilio_urls))]
# Serve javascript-common if in development
if settings.DEBUG:
urlpatterns += static('/javascript/',
......
......@@ -54,9 +54,11 @@ django-otp = "^0.7.4"
django-formtools = "^2.1"
django-two-factor-auth = "^1.9"
django-otp-yubikey = '^0.5.2'
twilio = { version = "^6.33", optional = true }
[tool.poetry.extras]
ldap = ["django-auth-ldap"]
twilio = ["twilio"]
[tool.poetry.dev-dependencies]
sphinx = "^2.1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment