Conversation
- test - template
- update doc strings
- unrelated to whatsapp just more modern, less cruncy box.
- working & tested
Update documentation.
moggers87
left a comment
There was a problem hiding this comment.
It's a good start, but there's a lot of stuff that shouldn't be here.
| @@ -1,5 +1,5 @@ | |||
| [bumpversion] | |||
| current_version = 1.15.5 | |||
| current_version = 1.16 | |||
There was a problem hiding this comment.
Can you remove the commits that change the version string? This is something that's done at release time.
|
|
||
| # The full version, including alpha/beta/rc tags. | ||
| release = '1.15.5' | ||
| release = '1.16' |
There was a problem hiding this comment.
Can you remove the commits that change the version string? This is something that's done at release time.
| setup( | ||
| name='django-two-factor-auth', | ||
| version='1.15.5', | ||
| version='1.16', |
There was a problem hiding this comment.
Can you remove the commits that change the version string? This is something that's done at release time.
| from two_factor.gateways import make_call, send_sms | ||
| from two_factor.gateways import make_call, send_sms, send_whatsapp | ||
|
|
||
| WHATSAPP = 'wa' |
There was a problem hiding this comment.
Not sure what this is for, it's only used in a few places. Also why are we using "wa" rather than "whatsapp"?
| 'inputmode': 'numeric', | ||
| 'autocomplete': 'one-time-code'}) | ||
| 'autocomplete': 'one-time-code', | ||
| 'style': f'width:{TWO_FACTOR_INPUT_WIDTH}px; height:{TWO_FACTOR_INPUT_HEIGHT}px;'}) |
There was a problem hiding this comment.
This won't work if a site is using CSP and disallows inline styles
There was a problem hiding this comment.
You are correct, I will remove this functionality from this pr.
| from .utils import totp_digits | ||
|
|
||
| TWO_FACTOR_INPUT_WIDTH = getattr(settings, 'TWO_FACTOR_INPUT_WIDTH', 100) | ||
| TWO_FACTOR_INPUT_HEIGHT = getattr(settings, 'TWO_FACTOR_INPUT_HEIGHT', 30) |
There was a problem hiding this comment.
It's not clear that we need this
| # Changelog | ||
|
|
||
| ## 1.15.6 | ||
| ### Changed |
There was a problem hiding this comment.
This should be
## Unreleased
### Added
| ## 1.15.6 | ||
| ### Changed | ||
| - Added WhatsApp as a token method through Twilio | ||
| - Added the ability to modify the token input size |
There was a problem hiding this comment.
I don't think modifying the token input size should be a part of this PR
|
Appreciate the feedback, i'll make the changes as soon as I can. |
This change takes advantage of the available phone methods and Twilio gateway to allow the user to select WhatsApp as their token method.
Description
In the same pattern as the SMS method, the new WhatsApp method is added along with some user-definable settings. The change also exposes the ability to set the size of the token input field which was a bit small by default. Appropriate documentation has also been added.
Motivation and Context
Fixes #678. WhatsApp has become a major communication protocol globally due to its reach, speed, and security. It seems natural that a user can receive a token via WhatsApp. It is also more secure than SMS.
How Has This Been Tested?
Using existing mock tests in the pattern of SMS. Sending a WhatsApp is akin to sending a SMS. The example app implementation also works as intended. The documentation was tested within a vanilla example app for corectness.
Screenshots (if appropriate):
Types of changes
Checklist: