-
-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add whatsapp method #679
base: master
Are you sure you want to change the base?
Add whatsapp method #679
Changes from all commits
ba6041b
f4f5454
15fefbe
72dd1d0
c046e49
20b7e49
f26e957
1263f22
74dcdd1
3578e82
6c8e048
56786c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 1.15.5 | ||
current_version = 1.16 | ||
commit = True | ||
tag = True | ||
tag_name = {new_version} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# Changelog | ||
|
||
## 1.15.6 | ||
### Changed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be
|
||
- Added WhatsApp as a token method through Twilio | ||
- Added the ability to modify the token input size | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think modifying the token input size should be a part of this PR |
||
|
||
## 1.15.5 | ||
### Fixed | ||
- Include transitively replaced migrations in phonenumber migration. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ | |
# | ||
|
||
# The full version, including alpha/beta/rc tags. | ||
release = '1.15.5' | ||
release = '1.16' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove the commits that change the version string? This is something that's done at release time. |
||
|
||
# The short X.Y version. | ||
version = '.'.join(release.split('.')[0:2]) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
setup( | ||
name='django-two-factor-auth', | ||
version='1.15.5', | ||
version='1.16', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove the commits that change the version string? This is something that's done at release time. |
||
description='Complete Two-Factor Authentication for Django', | ||
long_description=open('README.rst', encoding='utf-8').read(), | ||
author='Bouke Haarsma', | ||
|
@@ -21,6 +21,7 @@ | |
extras_require={ | ||
'call': ['twilio>=6.0'], | ||
'sms': ['twilio>=6.0'], | ||
'whatsapp': ['twilio>=6.0'], | ||
'webauthn': ['webauthn>=1.11.0,<1.99'], | ||
'yubikey': ['django-otp-yubikey'], | ||
'phonenumbers': ['phonenumbers>=7.0.9,<8.99'], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,12 @@ | |
from .plugins.registry import registry | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not clear that we need this |
||
|
||
class MethodForm(forms.Form): | ||
method = forms.ChoiceField(label=_("Method"), | ||
widget=forms.RadioSelect) | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
|
@@ -27,13 +28,13 @@ def __init__(self, **kwargs): | |
|
||
|
||
class DeviceValidationForm(forms.Form): | ||
token = forms.IntegerField(label=_("Token"), min_value=1, max_value=int('9' * totp_digits())) | ||
|
||
token = forms.IntegerField(label=_("Code"), min_value=1, max_value=int('9' * totp_digits())) | ||
token.widget.attrs.update({'autofocus': 'autofocus', | ||
'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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work if a site is using CSP and disallows inline styles There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are correct, I will remove this functionality from this pr. |
||
error_messages = { | ||
'invalid_token': _('Entered token is not valid.'), | ||
'invalid_token': _('Entered code is not valid.'), | ||
} | ||
|
||
def __init__(self, device, **kwargs): | ||
|
@@ -52,7 +53,8 @@ class TOTPDeviceForm(forms.Form): | |
|
||
token.widget.attrs.update({'autofocus': 'autofocus', | ||
'inputmode': 'numeric', | ||
'autocomplete': 'one-time-code'}) | ||
'autocomplete': 'one-time-code', | ||
'style': f'width:{TWO_FACTOR_INPUT_WIDTH}px; height:{TWO_FACTOR_INPUT_HEIGHT}px;'}) | ||
|
||
error_messages = { | ||
'invalid_token': _('Entered token is not valid.'), | ||
|
@@ -114,6 +116,7 @@ class AuthenticationTokenForm(OTPAuthenticationFormMixin, forms.Form): | |
'autofocus': 'autofocus', | ||
'pattern': '[0-9]*', # hint to show numeric keyboard for on-screen keyboards | ||
'autocomplete': 'one-time-code', | ||
'style': f'width:{TWO_FACTOR_INPUT_WIDTH}px; height:{TWO_FACTOR_INPUT_HEIGHT}px;' | ||
}) | ||
|
||
# Our authentication form has an additional submit button to go to the | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the commits that change the version string? This is something that's done at release time.