jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.71k stars 448 forks source link

computing phone method availability is done in different places using different criteria #665

Closed jpaniagualaconich closed 9 months ago

jpaniagualaconich commented 1 year ago

Expected Behavior

There should be a single way to check which phone methods are available.

Current Behavior

In some places availability is determined by the presence of 'two_factor.plugins.phonenumber' in INSTALLED_APPS. Other places take into account also / only values for settings.TWO_FACTOR_CALL_GATEWAY and settings.TWO_FACTOR_SMS_GATEWAY.

Possible Solution

We already have a method registry, which should be the only source of truth.