-
-
Notifications
You must be signed in to change notification settings - Fork 463
Open
Labels
Description
Is your feature request related to a problem? Please describe.
EmailDevice adds its own parameter extra_context to generate_challenge, which is nice, but isn't used anywhere (as far as I can tell). Passing context to my custom email template isn't possible.
Describe the solution you'd like
I did a first stab here in this branch: master...apapsch:django-two-factor-auth:context-data-for-email
Adding get_device_context_data method allows me to add context in my custom views.
This breaks some tests, because only EmailDevice has the extra_context parameter.
I have some questions about this:
- Is this approach adding
get_device_context_dataacceptable? - Would special casing
EmailDevice(or introspecting the method signature to look forextra_context) be acceptable? Or addextra_contextto the base method? The latter is more complicated, as the base method is defined indjango-otpdependency.
Describe alternatives you've considered
No alternative has been considered.